Announcement Announcement Module
Collapse
No announcement yet.
Issue using Integration to call a Web Service - Invalid Content-Type Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue using Integration to call a Web Service - Invalid Content-Type

    I modified the Integration Sample Apps "travel" application which uses: <spring.integration.version>2.2.0.RC2</spring.integration.version>

    I'm able to get the app to prompt me for a department Id but when it attempts the call it returns:

    Code:
    Enter a deptId: 3597
    <di:SearchRequest xmlns:di="http://qualcomm.com/corp/it/services/deptinfosvcs/">  <di:deptId>3597</di:deptId></di:SearchRequest>Nov 13, 2012 4:34:30 PM com.sun.xml.internal.messaging.saaj.soap.MessageImpl identifyContentType
    SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message
    The web service that I am attempting to invoke is an internal web service that was generated years ago using Tibco Businessworks -- consequently the generated wsdl is less than straightforward.

    Is it possible that the failure to recognize the Content-Type is due to the way the wsdl is defined? I saw in the travel sample app that the wsdl it calls references an operation defined as:
    Code:
    <wsdl:operation name="GetCityForecastByZIP">
      <http:operation location="/GetCityForecastByZIP" /> 
      <wsdl:input>
        <http:urlEncoded /> 
      </wsdl:input>
      <wsdl:output>
        <mime:mimeXml part="Body" /> 
      </wsdl:output>
    </wsdl:operation>
    The operation I'm trying to call is defined as:
    Code:
    <wsdl:operation name="QryByDeptIdOp">
      <wsdl:input message="tns:SearchRequest" /> 
      <wsdl:output message="tns:SearchReply" /> 
    </wsdl:operation>
    A successful request as sent by SOAP UI looks like this:
    Code:
    POST http://tibcrpprd04.qualcomm.com:9998/Project/GenWebServices/intfQryByDeptId-service.serviceagent/intfwsQryByDeptIdEndpoint0 HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: "/Project/GenWebServices/intfQryByDeptId-service.serviceagent/intfwsQryByDeptIdEndpoint0/QryByDeptIdOp"
    Content-Length: 321
    Host: tibcrpprd04.qualcomm.com:9998
    Connection: Keep-Alive
    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
    
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://qualcomm.com/mwss/services/deptinfosvcs/requests">
       <soapenv:Header/>
       <soapenv:Body>
          <req:SearchRequest>
             <req:deptId>3952</req:deptId>
          </req:SearchRequest>
       </soapenv:Body>
    </soapenv:Envelope>
    Is there a way to configure the request that I am sending to include the Content-Type? I tried to add it by editing the header-enricher's configuration but it said that the only valid child element was "soap-action" so I had to comment it out:

    Code:
    	<int-ws:header-enricher input-channel="deptChannel" output-channel="deptServiceChannel" >
    		<!--  <int-ws:header name="Content-Type" value="text/xml;charset=UTF-8" />   -->
    		<int-ws:soap-action value="http://personneldeptinfosvcs.qualcomm.com/Project/GenWebServices/intfQryByDeptId-service.serviceagent/intfwsQryByDeptIdEndpoint0/QryByDeptIdOp" />
    	</int-ws:header-enricher>
    Here is my attached project:
    Attachment

    UPDATE: Used WireShark to monitor TCP Thread...
    Code:
    POST /Project/GenWebServices/intfQryByDeptId-service.serviceagent?wsdl HTTP/1.1
    Accept-Encoding: gzip
    Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    SOAPAction: "http://personneldeptinfosvcs.qualcomm.com/Project/GenWebServices/intfQryByDeptId-service.serviceagent/intfwsQryByDeptIdEndpoint0/QryByDeptIdOp"
    Content-Type: text/xml; charset=utf-8
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.6.0_26
    Host: personneldeptinfosvcs.qualcomm.com
    Connection: keep-alive
    Content-Length: 275
    
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><di:SearchRequest xmlns:di="http://qualcomm.com/corp/it/services/deptinfosvcs/">  <di:deptId>3597</di:deptId></di:SearchRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>HTTP/1.1 200 OK
    Then it showed the entire wsdl instead of the <SearchReply> element response I was expecting.
    Attached Files
    Last edited by qualcommLisa; Nov 14th, 2012, 01:35 PM.

  • #2
    Here's the WireShark of a successful call to the web service from SOAP UI:
    Code:
    POST /Project/GenWebServices/intfQryByDeptId-service.serviceagent/intfwsQryByDeptIdEndpoint0 HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: "/Project/GenWebServices/intfQryByDeptId-service.serviceagent/intfwsQryByDeptIdEndpoint0/QryByDeptIdOp"
    Content-Length: 314
    Host: tibcrpprd04.qualcomm.com:9998
    Connection: Keep-Alive
    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
    
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://qualcomm.com/mwss/services/deptinfosvcs/requests">
       <soapenv:Header/>
       <soapenv:Body>
          <req:SearchRequest>
             <req:deptId>3597</req:deptId>
          </req:SearchRequest>
       </soapenv:Body>
    </soapenv:Envelope>HTTP/1.1 200 OK
    
    Server: Apache-Coyote/1.1
    Content-Type: text/xml;charset=utf-8
    Content-Length: 1638
    Date: Wed, 14 Nov 2012 18:46:55 GMT
    
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns0:SearchReply xmlns:ns0="http://qualcomm.com/mwss/services/deptinfosvcs/replies"><ns0:searchCondition>deptId = [3597]</ns0:searchCondition><ns0:msg>SUCCESS</ns0:msg><ns1:EmployeeAssignment xmlns:ns1="http://www.openapplications.org/oagis"><ns1:Division>QC01</ns1:Division><ns1:Department>Identity and Access Management</ns1:Department><ns1:qcDeptId>3597</ns1:qcDeptId><ns1:qcAffiliation>QUALCOMM Incorporated</ns1:qcAffiliation><ns1:UserArea><ns1:FieldValue><ns1:NameValue name="deptid" type="string">3597</ns1:NameValue></ns1:FieldValue><ns1:FieldValue><ns1:NameValue name="ora_deptid" type="string">03597</ns1:NameValue></ns1:FieldValue><ns1:FieldValue><ns1:NameValue name="dept_desc_long" type="string">Identity and Access Management</ns1:NameValue></ns1:FieldValue><ns1:FieldValue><ns1:NameValue name="bu_desc_long" type="string">Qualcomm Corporate</ns1:NameValue></ns1:FieldValue><ns1:FieldValue><ns1:NameValue name="analystId" type="string">21839</ns1:NameValue></ns1:FieldValue><ns1:FieldValue><ns1:NameValue name="analyst" type="string">Motley, David M. (Dave)</ns1:NameValue></ns1:FieldValue><ns1:FieldValue><ns1:NameValue name="eff_status" type="string">A</ns1:NameValue></ns1:FieldValue><ns1:FieldValue><ns1:NameValue name="eff_date" type="string">2012-08-30T00:00:00-07:00</ns1:NameValue></ns1:FieldValue></ns1:UserArea><ns1:BusinessUnit>Corporate </ns1:BusinessUnit><ns1:BusinessUnitId>00001</ns1:BusinessUnitId></ns1:EmployeeAssignment></ns0:SearchReply></SOAP-ENV:Body></SOAP-ENV:Envelope>
    And when I call the same web service from the application:
    Code:
    POST /Project/GenWebServices/intfQryByDeptId-service.serviceagent/intfwsQryByDeptIdEndpoint0 HTTP/1.1
    
    Accept-Encoding: gzip
    
    Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    
    SOAPAction: "/Project/GenWebServices/intfQryByDeptId-service.serviceagent/intfwsQryByDeptIdEndpoint0/QryByDeptIdOp"
    
    Content-Type: text/xml; charset=utf-8
    
    Cache-Control: no-cache
    
    Pragma: no-cache
    
    User-Agent: Java/1.6.0_26
    
    Host: tibcrpprd04.qualcomm.com:9998
    
    Connection: keep-alive
    
    Content-Length: 275
    
    
    
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><di:SearchRequest xmlns:di="http://qualcomm.com/corp/it/services/deptinfosvcs/">  <di:deptId>3597</di:deptId></di:SearchRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>HTTP/1.1 500 Internal Server Error
    
    Server: Apache-Coyote/1.1
    
    Content-Type: text/xml;charset=utf-8
    
    Content-Length: 608
    
    Date: Wed, 14 Nov 2012 20:20:54 GMT
    
    Connection: close
    
    
    
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xmlns="">SOAP-ENV:Server</faultcode><faultstring xmlns="">Internal Error</faultstring><detail xmlns=""><Data xmlns=""><ns0:SearchRequest xmlns:ns0="http://qualcomm.com/corp/it/services/deptinfosvcs"><parameters xmlns=""><di:SearchRequest xmlns:di="http://qualcomm.com/corp/it/services/deptinfosvcs/">  <di:deptId>3597</di:deptId></di:SearchRequest></parameters></ns0:SearchRequest></Data></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
    What am I missing?

    Comment


    • #3
      Resolved the issue - had the wrong xmlns defined. Sigh.

      Comment


      • #4
        Glad to hear you resolved it, and thanks for posting back to let us know.

        Comment

        Working...
        X