4 Replies Latest reply on Oct 9, 2007 10:26 AM by phillip pollard

    Web service parameters are always null

    phillip pollard Newbie

      I have a web service running on JBoss 4.2.1.GA. I have two different clients consuming the service. The 1st client is Remedy, a 3rd party service management application. Using tcpmon, I captured the SOAP document coming across. Here it is:

      POST /remedyAbstractService/remedyAbstractService_1_0 HTTP/1.0
      Content-Type: text/xml; charset=utf-8
      Accept: application/soap+xml, application/dime, multipart/related, text/*
      User-Agent: Axis/1.1
      Host: phpoll0905:8666
      Cache-Control: no-cache
      Pragma: no-cache
      SOAPAction: ""
      Content-Length: 1065
      
      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body><sendTicketRequestToPartner xmlns="http://MY_COMPANY.com/remedyAbstractService_1_0/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <remedyUserID>MY_USER</remedyUserID>
       <remedyPassword>MY_PASS</remedyPassword>
       <remedyTransactionCode>60</remedyTransactionCode>
       <remedyTPSID>00000002600</remedyTPSID>
       <remedyTicketNumber>ATS01994267</remedyTicketNumber>
       <partner>Initech</partne>
       <partnerTicketNumber>ats11111</partnerTicketNumber>
       <technicalNotes>2/19/2007 4:58:28 PM
       2/19/2007 4:50:33 PM asdfasdfasdfasdf 2/17/2006 3:15:24 PM iswebsvc tech notes
      </technicalNotes>
       <closedCode>my closed code</closedCode>
       <resolvedBy>guy who fixed it</resolvedBy>
       <solution>my solution</solution>
      </sendTicketRequestToPartner> </soapenv:Body>
      </soapenv:Envelope>


      With this request, all of the parameters of the web service are null. The client calls the web service successfully, but the parms are always null, even though values are being specified for each field, as you can see in the document above.

      I've also created a standard .NET client to consume the same service. When running it, the values from the client do reach the web service. The request SOAP document looks like this:
      POST /remedyAbstractService/remedyAbstractService_1_0 HTTP/1.1
      User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.2407)
      Content-Type: text/xml; charset=utf-8
      SOAPAction: ""
      Content-Length: 1014
      Expect: 100-continue
      Connection: Keep-Alive
      Host: phpoll0905:8666
      
      <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><sendTicketRequestToPartner xmlns="http://MY_COMPANY.com/remedyAbstractService_1_0/types"><remedyUserID xmlns="">MY_USER</remedyUserID><remedyPassword xmlns="">MY_PASS</remedyPassword><remedyTransactionCode xmlns="">60</remedyTransactionCode><remedyTPSID xmlns="">00000002600</remedyTPSID><remedyTicketNumber xmlns="">ATS01994267</remedyTicketNumber><partner xmlns="">Initech</partner><partnerTicketNumber xmlns="">ats11111</partnerTicketNumber><technicalNotes xmlns="">2/19/2007 4:58:28 PM 2/19/2007 4:50:33 PM asdfasdfasdfasdf 2/17/2006 3:15:24 PM iswebsvc tech notes</technicalNotes><closedCode xmlns="">my closed code</closedCode><resolvedBy xmlns="">guy who fixed it</resolvedBy><solution xmlns="">my solution</solution></sendTicketRequestToPartner></soap:Body></soap:Envelope>


      Why does the 2nd document work, yet the 1st one does not?

      Thanks.

        • 1. Re: Web service parameters are always null
          Richard Opalka Newbie

          It's xmlns="" declaration within all subelements of sendTicketRequestToPartner element.

          Richard

          • 2. Re: Web service parameters are always null
            phillip pollard Newbie

            Thanks for the response.

            Can you explain why it works like that, especially when the xmlns attribute is empty on each one?

            • 3. Re: Web service parameters are always null
              Richard Opalka Newbie

              Well,

              to answer this question I need to see your WSDL

              Richard

              • 4. Re: Web service parameters are always null
                phillip pollard Newbie

                Here it is:

                <definitions name='AbstractBeanService' targetNamespace='http://company.com/remedyAbstractService_1_0/types' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://company.com/remedyAbstractService_1_0/types' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
                 <types>
                 <xs:schema targetNamespace='http://company.com/remedyAbstractService_1_0/types' version='1.0' xmlns:tns='http://company.com/remedyAbstractService_1_0/types' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
                 <xs:element name='sendTicketRequestToPartner' type='tns:sendTicketRequestToPartner'/>
                 <xs:element name='sendTicketRequestToPartnerResponse' type='tns:sendTicketRequestToPartnerResponse'/>
                 <xs:complexType name='sendTicketRequestToPartner'>
                 <xs:sequence>
                 <xs:element minOccurs='0' name='remedyUserID' type='xs:string'/>
                 <xs:element minOccurs='0' name='remedyPassword' type='xs:string'/>
                 <xs:element name='remedyTransactionCode' type='xs:int'/>
                 <xs:element minOccurs='0' name='remedyTPSID' type='xs:string'/>
                 <xs:element minOccurs='0' name='remedyTicketNumber' type='xs:string'/>
                 <xs:element minOccurs='0' name='partner' type='xs:string'/>
                 <xs:element minOccurs='0' name='partnerTicketNumber' type='xs:string'/>
                 <xs:element minOccurs='0' name='technicalNotes' type='xs:string'/>
                 <xs:element minOccurs='0' name='closedCode' type='xs:string'/>
                 <xs:element minOccurs='0' name='resolvedBy' type='xs:string'/>
                 <xs:element minOccurs='0' name='solution' type='xs:string'/>
                 </xs:sequence>
                 </xs:complexType>
                 <xs:complexType name='sendTicketRequestToPartnerResponse'>
                 <xs:sequence>
                 <xs:element minOccurs='0' name='result' type='xs:string'/>
                 </xs:sequence>
                 </xs:complexType>
                 </xs:schema>
                 </types>
                 <message name='AbstractBean_sendTicketRequestToPartner'>
                 <part element='tns:sendTicketRequestToPartner' name='sendTicketRequestToPartner'></part>
                 </message>
                 <message name='AbstractBean_sendTicketRequestToPartnerResponse'>
                 <part element='tns:sendTicketRequestToPartnerResponse' name='sendTicketRequestToPartnerResponse'></part>
                 </message>
                 <portType name='AbstractBean'>
                 <operation name='sendTicketRequestToPartner' parameterOrder='sendTicketRequestToPartner'>
                 <input message='tns:AbstractBean_sendTicketRequestToPartner'></input>
                 <output message='tns:AbstractBean_sendTicketRequestToPartnerResponse'></output>
                 </operation>
                 </portType>
                 <binding name='AbstractBeanBinding' type='tns:AbstractBean'>
                 <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
                 <operation name='sendTicketRequestToPartner'>
                 <soap:operation soapAction=''/>
                 <input>
                 <soap:body use='literal'/>
                 </input>
                 <output>
                 <soap:body use='literal'/>
                 </output>
                 </operation>
                 </binding>
                 <service name='AbstractBeanService'>
                 <port binding='tns:AbstractBeanBinding' name='AbstractBeanPort'>
                 <soap:address location='http://localhost:8080/remedyAbstractService/remedyAbstractService_1_0'/>
                 </port>
                 </service>
                </definitions>