NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
NuSoap with NET webservice connects,but gives http 400 error


Joined: 22 Sep 2009
Posts: 2
Reply with quote
Hi all,

I have a NuSoap client which connects to a .NET webservice. The connection is established and the requested method is found, however the response gives an error: "HTTP Error: Unsupported HTTP response status 400 Bad Request (soapclient->response has contents of the response)".

My guess is that the Bad Request is caused by the following issue: "entered send() with data of length: 0". But I do give some data to de sent.

What am I doing wrong?



Here the complete NuSoap debug data:

Code:

Error

HTTP Error: Unsupported HTTP response status 400 Bad Request (soapclient->response has contents of the response)

Request

POST /webservices/Milieubelasting/milieubelasting.asmx HTTP/1.0
Host: myserver
User-Agent: NuSOAP/0.7.3 (1.114)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://myserver/Milieubelasting/GetMilieubelasting"
Content-Length: 711

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><UserName>DGBC</UserName><Password>********</Password></SOAP-ENV:Header><SOAP-ENV:Body><?xml version="1.0" encoding="utf-8" ?><Gebouw xmlns="http://myserver/Milieubelasting"><Levensduur>75</Levensduur><Materialen><Materiaal><Code>20100102</Code><Hoeveelheid>33</Hoeveelheid></Materiaal><Materiaal><Code>20100506</Code><Hoeveelheid>100</Hoeveelheid></Materiaal></Materialen></Gebouw></SOAP-ENV:Body></SOAP-ENV:Envelope>

Response

HTTP/1.1 400 Bad Request
Cache-Control: private
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Tue, 22 Sep 2009 13:47:40 GMT
Connection: close
Content-Length: 0

Debug

2009-09-22 15:47:39.140086 soapclient: ctor wsdl=1 timeout=0 response_timeout=30
endpoint=string(71) "http://myserver/webservices/Milieubelasting/milieubelasting.asmx?wsdl"
2009-09-22 15:47:39.140508 soapclient: will use lazy evaluation of wsdl from http://myserver/webservices/Milieubelasting/milieubelasting.asmx?wsdl
2009-09-22 15:47:39.141046 soapclient: call: operation=GetMilieubelasting, namespace=http://schemas.xmlsoap.org/soap/envelope/, soapAction=http://myserver/Milieubelasting/ValidateXML, rpcParams=, style=document, use=literal, endpointType=wsdl
params=string(297) "<?xml version="1.0" encoding="utf-8" ?><Gebouw xmlns="http://myserver/Milieubelasting"><Levensduur>75</Levensduur><Materialen><Materiaal><Code>20100102</Code><Hoeveelheid>33</Hoeveelheid></Materiaal><Materiaal><Code>20100506</Code><Hoeveelheid>100</Hoeveelheid></Materiaal></Materialen></Gebouw>"
headers=array(2) {
  ["UserName"]=>
  string(4) "DGBC"
  ["Password"]=>
  string(8) "********"
}
2009-09-22 15:47:39.141391 soapclient: instantiating wsdl class with doc: http://myserver/webservices/Milieubelasting/milieubelasting.asmx?wsdl
2009-09-22 15:47:39.141753 wsdl: ctor wsdl= timeout=0 response_timeout=30
2009-09-22 15:47:39.142049 wsdl: parse and process WSDL path=
2009-09-22 15:47:39.143741 wsdl: setCredentials username= authtype= certRequest=
array(0) {
}
2009-09-22 15:47:39.144169 wsdl: parse and process WSDL path=http://myserver/webservices/Milieubelasting/milieubelasting.asmx?wsdl
2009-09-22 15:47:39.144464 wsdl: parse WSDL at path=http://myserver/webservices/Milieubelasting/milieubelasting.asmx?wsdl
2009-09-22 15:47:39.144756 wsdl: getting WSDL http(s) URL http://myserver/webservices/Milieubelasting/milieubelasting.asmx?wsdl
2009-09-22 15:47:39.145111 soap_transport_http: ctor url=http://myserver/webservices/Milieubelasting/milieubelasting.asmx?wsdl use_curl= curl_options:
array(0) {
}
2009-09-22 15:47:39.145431 soap_transport_http: parsed URL scheme = http
2009-09-22 15:47:39.145720 soap_transport_http: parsed URL host = myserver
2009-09-22 15:47:39.145997 soap_transport_http: parsed URL path = /webservices/Milieubelasting/milieubelasting.asmx
2009-09-22 15:47:39.146456 soap_transport_http: parsed URL query = wsdl
2009-09-22 15:47:39.146754 soap_transport_http: set header Host: myserver
2009-09-22 15:47:39.147085 soap_transport_http: set header User-Agent: NuSOAP/0.7.3 (1.114)
2009-09-22 15:47:39.147389 soap_transport_http: set header Accept-Encoding: gzip, deflate
2009-09-22 15:47:39.147674 soap_transport_http: set header Connection: close
2009-09-22 15:47:39.147967 soap_transport_http: entered send() with data of length: 0
2009-09-22 15:47:39.148255 soap_transport_http: connect connection_timeout 0, response_timeout 30, scheme http, host myserver, port 80
2009-09-22 15:47:39.148556 soap_transport_http: calling fsockopen with host myserver connection_timeout 0
2009-09-22 15:47:39.174879 soap_transport_http: set response timeout to 30
2009-09-22 15:47:39.175264 soap_transport_http: socket connected
2009-09-22 15:47:39.175799 soap_transport_http: set header Content-Length: 0
2009-09-22 15:47:39.176094 soap_transport_http: HTTP request: GET /webservices/Milieubelasting/milieubelasting.asmx?wsdl HTTP/1.1
2009-09-22 15:47:39.176380 soap_transport_http: HTTP header: Host: myserver
2009-09-22 15:47:39.176657 soap_transport_http: HTTP header: User-Agent: NuSOAP/0.7.3 (1.114)
2009-09-22 15:47:39.176935 soap_transport_http: HTTP header: Accept-Encoding: gzip, deflate
2009-09-22 15:47:39.177212 soap_transport_http: HTTP header: Connection: close
2009-09-22 15:47:39.177491 soap_transport_http: HTTP header: Content-Length: 0
2009-09-22 15:47:39.177912 soap_transport_http: wrote data to socket, length = 193
2009-09-22 15:47:39.446436 soap_transport_http: read line of 17 bytes: HTTP/1.1 200 OK
2009-09-22 15:47:39.446831 soap_transport_http: read line of 35 bytes: Cache-Control: private, max-age=0
2009-09-22 15:47:39.447123 soap_transport_http: read line of 39 bytes: Content-Type: text/xml; charset=utf-8
2009-09-22 15:47:39.447618 soap_transport_http: read line of 27 bytes: Server: Microsoft-IIS/7.0
2009-09-22 15:47:39.448028 soap_transport_http: read line of 29 bytes: X-AspNet-Version: 2.0.50727
2009-09-22 15:47:39.448319 soap_transport_http: read line of 23 bytes: X-Powered-By: ASP.NET
2009-09-22 15:47:39.448610 soap_transport_http: read line of 37 bytes: Date: Tue, 22 Sep 2009 13:47:39 GMT
2009-09-22 15:47:39.448906 soap_transport_http: read line of 19 bytes: Connection: close
2009-09-22 15:47:39.449195 soap_transport_http: read line of 22 bytes: Content-Length: 5714
2009-09-22 15:47:39.449485 soap_transport_http: read line of 2 bytes:
2009-09-22 15:47:39.449830 soap_transport_http: found end of headers after length 250
2009-09-22 15:47:39.450419 soap_transport_http: want to read content of length 5714
2009-09-22 15:47:39.450786 soap_transport_http: read buffer of 2510 bytes
2009-09-22 15:47:39.464458 soap_transport_http: read buffer of 1380 bytes
2009-09-22 15:47:39.466436 soap_transport_http: read buffer of 1824 bytes
2009-09-22 15:47:39.466814 soap_transport_http: read to EOF
2009-09-22 15:47:39.467098 soap_transport_http: read body of length 5714
2009-09-22 15:47:39.467388 soap_transport_http: received a total of 5964 bytes of data from server
2009-09-22 15:47:39.467797 soap_transport_http: closed socket
2009-09-22 15:47:39.468136 soap_transport_http: No Content-Encoding header
2009-09-22 15:47:39.468425 soap_transport_http: end of send()
2009-09-22 15:47:39.468931 wsdl: got WSDL URL
2009-09-22 15:47:39.469228 wsdl: Parse WSDL
2009-09-22 15:47:39.470236 wsdl: Parsing WSDL schema
2009-09-22 15:47:39.470625 nusoap_xmlschema: nusoap_xmlschema class instantiated, inside constructor
2009-09-22 15:47:39.471222 nusoap_xmlschema: <http://myserver/Milieubelasting> processing untyped element GetMilieubelasting type _GetMilieubelasting_ContainedType
2009-09-22 15:47:39.471740 nusoap_xmlschema: <http://myserver/Milieubelasting> add element GetMilieubelasting to elements array
2009-09-22 15:47:39.472170 nusoap_xmlschema: <http://myserver/Milieubelasting> processing unnamed complexType for element GetMilieubelasting named _GetMilieubelasting_ContainedType
2009-09-22 15:47:39.472728 nusoap_xmlschema: <http://myserver/Milieubelasting> processing typed element xmlInput of type http://www.w3.org/2001/XMLSchema:string
2009-09-22 15:47:39.475285 nusoap_xmlschema: <http://myserver/Milieubelasting> add element xmlInput to complexType _GetMilieubelasting_ContainedType
2009-09-22 15:47:39.475684 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element xmlInput
2009-09-22 15:47:39.476103 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing complexType _GetMilieubelasting_ContainedType
2009-09-22 15:47:39.476450 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element GetMilieubelasting
2009-09-22 15:47:39.477088 nusoap_xmlschema: <http://myserver/Milieubelasting> processing untyped element GetMilieubelastingResponse type _GetMilieubelastingResponse_ContainedType
2009-09-22 15:47:39.477403 nusoap_xmlschema: <http://myserver/Milieubelasting> add element GetMilieubelastingResponse to elements array
2009-09-22 15:47:39.477805 nusoap_xmlschema: <http://myserver/Milieubelasting> processing unnamed complexType for element GetMilieubelastingResponse named _GetMilieubelastingResponse_ContainedType
2009-09-22 15:47:39.478362 nusoap_xmlschema: <http://myserver/Milieubelasting> processing typed element GetMilieubelastingResult of type http://www.w3.org/2001/XMLSchema:string
2009-09-22 15:47:39.478679 nusoap_xmlschema: <http://myserver/Milieubelasting> add element GetMilieubelastingResult to complexType _GetMilieubelastingResponse_ContainedType
2009-09-22 15:47:39.479023 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element GetMilieubelastingResult
2009-09-22 15:47:39.479563 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing complexType _GetMilieubelastingResponse_ContainedType
2009-09-22 15:47:39.479930 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element GetMilieubelastingResponse
2009-09-22 15:47:39.480370 nusoap_xmlschema: <http://myserver/Milieubelasting> processing typed element Milieubelasting_Header of type http://myserver/Milieubelasting:Milieubelasting_Header
2009-09-22 15:47:39.480681 nusoap_xmlschema: <http://myserver/Milieubelasting> add element Milieubelasting_Header to elements array
2009-09-22 15:47:39.481030 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element Milieubelasting_Header
2009-09-22 15:47:39.481433 nusoap_xmlschema: <http://myserver/Milieubelasting> processing named complexType Milieubelasting_Header
2009-09-22 15:47:39.481985 nusoap_xmlschema: <http://myserver/Milieubelasting> processing typed element UserName of type http://www.w3.org/2001/XMLSchema:string
2009-09-22 15:47:39.482680 nusoap_xmlschema: <http://myserver/Milieubelasting> add element UserName to complexType Milieubelasting_Header
2009-09-22 15:47:39.484426 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element UserName
2009-09-22 15:47:39.485181 nusoap_xmlschema: <http://myserver/Milieubelasting> processing typed element Password of type http://www.w3.org/2001/XMLSchema:string
2009-09-22 15:47:39.485511 nusoap_xmlschema: <http://myserver/Milieubelasting> add element Password to complexType Milieubelasting_Header
2009-09-22 15:47:39.485861 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element Password
2009-09-22 15:47:39.486371 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing complexType Milieubelasting_Header
2009-09-22 15:47:39.486787 nusoap_xmlschema: <http://myserver/Milieubelasting> processing untyped element ValidateXML type _ValidateXML_ContainedType
2009-09-22 15:47:39.487092 nusoap_xmlschema: <http://myserver/Milieubelasting> add element ValidateXML to elements array
2009-09-22 15:47:39.487679 nusoap_xmlschema: <http://myserver/Milieubelasting> processing unnamed complexType for element ValidateXML named _ValidateXML_ContainedType
2009-09-22 15:47:39.488251 nusoap_xmlschema: <http://myserver/Milieubelasting> processing typed element xmlInput of type http://www.w3.org/2001/XMLSchema:string
2009-09-22 15:47:39.488583 nusoap_xmlschema: <http://myserver/Milieubelasting> add element xmlInput to complexType _ValidateXML_ContainedType
2009-09-22 15:47:39.488931 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element xmlInput
2009-09-22 15:47:39.489330 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing complexType _ValidateXML_ContainedType
2009-09-22 15:47:39.489673 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element ValidateXML
2009-09-22 15:47:39.490255 nusoap_xmlschema: <http://myserver/Milieubelasting> processing untyped element ValidateXMLResponse type _ValidateXMLResponse_ContainedType
2009-09-22 15:47:39.490576 nusoap_xmlschema: <http://myserver/Milieubelasting> add element ValidateXMLResponse to elements array
2009-09-22 15:47:39.491012 nusoap_xmlschema: <http://myserver/Milieubelasting> processing unnamed complexType for element ValidateXMLResponse named _ValidateXMLResponse_ContainedType
2009-09-22 15:47:39.491576 nusoap_xmlschema: <http://myserver/Milieubelasting> processing typed element ValidateXMLResult of type http://www.w3.org/2001/XMLSchema:boolean
2009-09-22 15:47:39.491898 nusoap_xmlschema: <http://myserver/Milieubelasting> add element ValidateXMLResult to complexType _ValidateXMLResponse_ContainedType
2009-09-22 15:47:39.492249 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element ValidateXMLResult
2009-09-22 15:47:39.492648 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing complexType _ValidateXMLResponse_ContainedType
2009-09-22 15:47:39.495662 nusoap_xmlschema: <http://myserver/Milieubelasting> done processing element ValidateXMLResponse
2009-09-22 15:47:39.496042 wsdl: Parsing WSDL schema done
2009-09-22 15:47:39.496608 wsdl: msg GetMilieubelastingSoapIn: found part (with element) parameters: parameters,http://myserver/Milieubelasting:GetMilieubelasting
2009-09-22 15:47:39.497151 wsdl: msg GetMilieubelastingSoapOut: found part (with element) parameters: parameters,http://myserver/Milieubelasting:GetMilieubelastingResponse
2009-09-22 15:47:39.497686 wsdl: msg GetMilieubelastingMilieubelasting_Header: found part (with element) Milieubelasting_Header: Milieubelasting_Header,http://myserver/Milieubelasting:Milieubelasting_Header
2009-09-22 15:47:39.498403 wsdl: msg ValidateXMLSoapIn: found part (with element) parameters: parameters,http://myserver/Milieubelasting:ValidateXML
2009-09-22 15:47:39.498957 wsdl: msg ValidateXMLSoapOut: found part (with element) parameters: parameters,http://myserver/Milieubelasting:ValidateXMLResponse
2009-09-22 15:47:39.499460 wsdl: portType MilieubelastingSoap operation: GetMilieubelasting
2009-09-22 15:47:39.500105 wsdl: portType MilieubelastingSoap operation: ValidateXML
2009-09-22 15:47:39.500996 wsdl: current binding: MilieubelastingSoap of portType: http://myserver/Milieubelasting:MilieubelastingSoap
2009-09-22 15:47:39.501512 wsdl: current binding operation: GetMilieubelasting
2009-09-22 15:47:39.502547 wsdl: current binding operation: ValidateXML
2009-09-22 15:47:39.503826 wsdl: current binding: MilieubelastingSoap12 of portType: http://myserver/Milieubelasting:MilieubelastingSoap
2009-09-22 15:47:39.504354 wsdl: current binding operation: GetMilieubelasting
2009-09-22 15:47:39.505383 wsdl: current binding operation: ValidateXML
2009-09-22 15:47:39.506509 wsdl: current service: Milieubelasting
2009-09-22 15:47:39.506937 wsdl: current port: MilieubelastingSoap
2009-09-22 15:47:39.507485 wsdl: current port: MilieubelastingSoap12
2009-09-22 15:47:39.508014 wsdl: Parsing WSDL done
2009-09-22 15:47:39.508361 wsdl: post-parse data gathering for GetMilieubelasting
2009-09-22 15:47:39.508883 wsdl: post-parse data gathering for ValidateXML
2009-09-22 15:47:39.509231 wsdl: post-parse data gathering for GetMilieubelasting
2009-09-22 15:47:39.509568 wsdl: post-parse data gathering for ValidateXML
2009-09-22 15:47:39.509958 soapclient: checkWSDL
2009-09-22 15:47:39.510285 soapclient: got 2 operations from wsdl http://myserver/webservices/Milieubelasting/milieubelasting.asmx?wsdl for binding type soap
2009-09-22 15:47:39.510586 soapclient: found operation
opData=array(9) {
  ["name"]=>
  string(18) "GetMilieubelasting"
  ["binding"]=>
  string(19) "MilieubelastingSoap"
  ["endpoint"]=>
  string(66) "http://myserver/webservices/Milieubelasting/milieubelasting.asmx"
  ["soapAction"]=>
  string(52) "http://myserver/Milieubelasting/GetMilieubelasting"
  ["style"]=>
  string(8) "document"
  ["input"]=>
  array(4) {
    ["use"]=>
    string(7) "literal"
    ["headers"]=>
    array(1) {
      [0]=>
      array(3) {
        ["message"]=>
        string(74) "http://myserver/Milieubelasting:GetMilieubelastingMilieubelasting_Header"
        ["part"]=>
        string(22) "Milieubelasting_Header"
        ["use"]=>
        string(7) "literal"
      }
    }
    ["message"]=>
    string(24) "GetMilieubelastingSoapIn"
    ["parts"]=>
    array(1) {
      ["parameters"]=>
      string(53) "http://myserver/Milieubelasting:GetMilieubelasting^"
    }
  }
  ["output"]=>
  array(3) {
    ["use"]=>
    string(7) "literal"
    ["message"]=>
    string(25) "GetMilieubelastingSoapOut"
    ["parts"]=>
    array(1) {
      ["parameters"]=>
      string(61) "http://myserver/Milieubelasting:GetMilieubelastingResponse^"
    }
  }
  ["transport"]=>
  string(36) "http://schemas.xmlsoap.org/soap/http"
  ["documentation"]=>
  string(0) ""
}
2009-09-22 15:47:39.510983 soapclient: serializing param string for WSDL operation GetMilieubelasting
2009-09-22 15:47:39.511308 soapclient: In serializeEnvelope length=297 body (max 10000 characters)=<?xml version="1.0" encoding="utf-8" ?><Gebouw xmlns="http://myserver/Milieubelasting"><Levensduur>75</Levensduur><Materialen><Materiaal><Code>20100102</Code><Hoeveelheid>33</Hoeveelheid></Materiaal><Materiaal><Code>20100506</Code><Hoeveelheid>100</Hoeveelheid></Materiaal></Materialen></Gebouw> style=document use=literal encodingStyle=
2009-09-22 15:47:39.511750 soapclient: headers:
array(2) {
  ["UserName"]=>
  string(4) "DGBC"
  ["Password"]=>
  string(8) "********"
}
2009-09-22 15:47:39.512052 soapclient: namespaces:
array(1) {
  ["SOAP-ENV"]=>
  string(41) "http://schemas.xmlsoap.org/soap/envelope/"
}
2009-09-22 15:47:39.512387 soapclient: in serialize_val: name=UserName, type=, name_ns=, type_ns=, use=literal, soapval=
value=string(4) "DGBC"
attributes=bool(false)
2009-09-22 15:47:39.512719 soapclient: serialize_val: serialize string
2009-09-22 15:47:39.515407 soapclient: serialize_val returning <UserName>DGBC</UserName>
2009-09-22 15:47:39.515737 soapclient: in serialize_val: name=Password, type=, name_ns=, type_ns=, use=literal, soapval=
value=string(8) "********"
attributes=bool(false)
2009-09-22 15:47:39.516077 soapclient: serialize_val: serialize string
2009-09-22 15:47:39.516377 soapclient: serialize_val returning <Password>********</Password>
2009-09-22 15:47:39.516664 soapclient: In serializeEnvelope, serialized array of headers to <UserName>DGBC</UserName><Password>********</Password>
2009-09-22 15:47:39.517181 soapclient: endpoint=http://myserver/webservices/Milieubelasting/milieubelasting.asmx, soapAction=http://myserver/Milieubelasting/GetMilieubelasting, namespace=http://schemas.xmlsoap.org/soap/envelope/, style=document, use=literal, encodingStyle=
2009-09-22 15:47:39.517469 soapclient: SOAP message length=711 contents (max 10000 bytes)=<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><UserName>DGBC</UserName><Password>********</Password></SOAP-ENV:Header><SOAP-ENV:Body><?xml version="1.0" encoding="utf-8" ?><Gebouw xmlns="http://myserver/Milieubelasting"><Levensduur>75</Levensduur><Materialen><Materiaal><Code>20100102</Code><Hoeveelheid>33</Hoeveelheid></Materiaal><Materiaal><Code>20100506</Code><Hoeveelheid>100</Hoeveelheid></Materiaal></Materialen></Gebouw></SOAP-ENV:Body></SOAP-ENV:Envelope>
2009-09-22 15:47:39.517783 soapclient: transporting via HTTP
2009-09-22 15:47:39.520653 soapclient: sending message, length=711
2009-09-22 15:47:39.518105 soap_transport_http: ctor url=http://myserver/webservices/Milieubelasting/milieubelasting.asmx use_curl= curl_options:
array(0) {
}
2009-09-22 15:47:39.518423 soap_transport_http: parsed URL scheme = http
2009-09-22 15:47:39.518703 soap_transport_http: parsed URL host = myserver
2009-09-22 15:47:39.518980 soap_transport_http: parsed URL path = /webservices/Milieubelasting/milieubelasting.asmx
2009-09-22 15:47:39.519275 soap_transport_http: set header Host: myserver
2009-09-22 15:47:39.519764 soap_transport_http: set header User-Agent: NuSOAP/0.7.3 (1.114)
2009-09-22 15:47:39.520078 soap_transport_http: set header Content-Type: text/xml; charset=UTF-8
2009-09-22 15:47:39.520365 soap_transport_http: set header SOAPAction: "http://myserver/Milieubelasting/GetMilieubelasting"
2009-09-22 15:47:39.520946 soap_transport_http: entered send() with data of length: 711
2009-09-22 15:47:39.521236 soap_transport_http: connect connection_timeout 0, response_timeout 30, scheme http, host myserver, port 80
2009-09-22 15:47:39.521538 soap_transport_http: calling fsockopen with host myserver connection_timeout 0
2009-09-22 15:47:39.545425 soap_transport_http: set response timeout to 30
2009-09-22 15:47:39.545810 soap_transport_http: socket connected
2009-09-22 15:47:39.546322 soap_transport_http: set header Content-Length: 711
2009-09-22 15:47:39.546620 soap_transport_http: HTTP request: POST /webservices/Milieubelasting/milieubelasting.asmx HTTP/1.0
2009-09-22 15:47:39.546906 soap_transport_http: HTTP header: Host: myserver
2009-09-22 15:47:39.547185 soap_transport_http: HTTP header: User-Agent: NuSOAP/0.7.3 (1.114)
2009-09-22 15:47:39.547463 soap_transport_http: HTTP header: Content-Type: text/xml; charset=UTF-8
2009-09-22 15:47:39.547741 soap_transport_http: HTTP header: SOAPAction: "http://myserver/Milieubelasting/GetMilieubelasting"
2009-09-22 15:47:39.548020 soap_transport_http: HTTP header: Content-Length: 711
2009-09-22 15:47:39.548423 soap_transport_http: wrote data to socket, length = 958
2009-09-22 15:47:39.690680 soap_transport_http: read line of 26 bytes: HTTP/1.1 400 Bad Request
2009-09-22 15:47:39.691087 soap_transport_http: read line of 24 bytes: Cache-Control: private
2009-09-22 15:47:39.691383 soap_transport_http: read line of 27 bytes: Server: Microsoft-IIS/7.0
2009-09-22 15:47:39.691674 soap_transport_http: read line of 29 bytes: X-AspNet-Version: 2.0.50727
2009-09-22 15:47:39.691965 soap_transport_http: read line of 23 bytes: X-Powered-By: ASP.NET
2009-09-22 15:47:39.692260 soap_transport_http: read line of 37 bytes: Date: Tue, 22 Sep 2009 13:47:40 GMT
2009-09-22 15:47:39.692553 soap_transport_http: read line of 19 bytes: Connection: close
2009-09-22 15:47:39.693015 soap_transport_http: read line of 19 bytes: Content-Length: 0
2009-09-22 15:47:39.694454 soap_transport_http: read line of 2 bytes:
2009-09-22 15:47:39.694802 soap_transport_http: found end of headers after length 206
2009-09-22 15:47:39.695222 soap_transport_http: want to read content of length 0
2009-09-22 15:47:39.695787 soap_transport_http: read to EOF
2009-09-22 15:47:39.696079 soap_transport_http: read body of length 0
2009-09-22 15:47:39.696361 soap_transport_http: received a total of 206 bytes of data from server
2009-09-22 15:47:39.696823 soap_transport_http: closed socket
2009-09-22 15:47:39.697177 soap_transport_http: end of send()
2009-09-22 15:47:39.697539 soapclient: Error: HTTP Error: Unsupported HTTP response status 400 Bad Request (soapclient->response has contents of the response)


Here the php code:

Code:

// include the SOAP class
require_once('nusoap/nusoap.php');

// define the soapaction as found in the wsdl - yournamespase/webservicename
$soapAction = "http://myserver/Milieubelasting/GetMilieubelasting";
$operation = "GetMilieubelasting";

// path to asmx-file
$wsdl="http://myserver/webservices/Milieubelasting/milieubelasting.asmx?wsdl";

// name space found in WSDL - wsdl:definitions targetNamespace="http://myserver/Milieubelasting"
$namespace = "http://schemas.xmlsoap.org/soap/envelope/";

// Crete a new SOAP client
$client = new soapclient($wsdl, true);
      
// Set encoding style
//$client->soap_defencoding = 'UTF-8';

// Set username and password
//$client->setCredentials('DGBC', '********');

// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
}

// make the message
$message = '<?xml version="1.0" encoding="utf-8" ?><Gebouw xmlns="http://myserver/Milieubelasting"><Levensduur>75</Levensduur><Materialen><Materiaal><Code>20100102</Code><Hoeveelheid>33</Hoeveelheid></Materiaal><Materiaal><Code>20100506</Code><Hoeveelheid>100</Hoeveelheid></Materiaal></Materialen></Gebouw>';

$headers = array('UserName' => "DGBC", 'Password' => "********");

// send the request or XML
$response = $client->call($operation, $message, $namespace, $soapAction, $headers, '', 'document', 'literal');

// Check for a fault
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($response);
    echo '</pre>';
} else {
    // Check for errors
    $err = $client->getError();
    if ($err) {
        // Display the error
        echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
        // Display the result
        echo '<h2>Result</h2><pre>';
        print_r($response);
    echo '</pre>';
    }
}

echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
View user's profileFind all posts by MathijsSend private message


Joined: 22 Sep 2009
Posts: 2
Reply with quote
I found the answer.

The .NET webservice requires an object as input, you can make the soap message an object using array('object_name' => 'The_message') as the soap message. The webservice will extract the 'object' from the message.

If you are not sure which object you need, take a good look at the wsdl file.

Regards,

-Mathijs
View user's profileFind all posts by MathijsSend private message


Joined: 04 Jul 2013
Posts: 1
Reply with quote
Mathijs wrote:
I found the answer.

The .NET webservice requires an object as input, you can make the soap message an object using array('object_name' => 'The_message') as the soap message. The webservice will extract the 'object' from the message.

If you are not sure which object you need, take a good look at the wsdl file.

Regards,

-Mathijs



Sir can you give an example on how this object works.

Thanks
View user's profileFind all posts by DeMonixSend private message
NuSoap with NET webservice connects,but gives http 400 error
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic