Announcement Announcement Module
Collapse
No announcement yet.
Random NullPointerException when calling a web service running on Oracle ESB Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Random NullPointerException when calling a web service running on Oracle ESB

    I have been using spring ws successfully for the past months, but now I am trying to call a web service running on Oracle SOA Suite (were using the Enterprise Service Bus feature) and I keep getting a NPE???

    The only thing that is different from some more straight forward web services (where everything is in one WSDL) is that their WSDL import's another WSDL that defines my XML Schema and other things.

    I have tried stepping through the spring ws 1.0.3 codebase and can't seem to figure out what I'm doing wrong. I can even execute the web service on the ESB using SoapUI, but not using Spring WebServiceClient??

    Any help is very appreciated!


    Test SOAP message being sent via WebServiceClientTemplate:


    Code:
    <con:publish-all-model-years requested-by="?">
            <con:recipients>
                <con:recipient name="?"/>
            </con:recipients>
        </con:publish-all-model-years>
    </con:vehicle-publish-control>

    Here is the WSDL that ESB is publishing that includes another WSDL (other WSDL being imported is below):
    Code:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <definitions targetNamespace="http://oracle.com/esb/namespaces/Vdm" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://oracle.com/esb/namespaces/Vdm" xmlns:ws="http://www.example.com/webservice" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:esb="http://www.oracle.com/esb/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:import="http://oracle.com/esb/namespaces/Vdm">
        <import namespace="http://oracle.com/esb/namespaces/Vdm" location="http://day-int2.edmunds.hq:8889/esb/slide/ESB_Projects/VDM_VdmEsb/Vdm_ControlRouter.wsdl"/>
        <binding name="__esb_ControlRouter_execute_ppt" type="tns:execute_ppt">
          <esb:binding/>
            <operation name="execute">
          <esb:operation event-name="Vdm.ControlRouter.execute"/>
                <input/>
            </operation>
        </binding>
    
        <binding name="__soap_ControlRouter_execute_ppt" type="tns:execute_ppt">
            <soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <operation name="execute">
                <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" soapAction="execute"/>
                <input>
                    <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
                </input>
            </operation>
        </binding>
    
        <service name="execute_pptService">
            <port name="__soap_ControlRouter_execute_ppt" binding="tns:__soap_ControlRouter_execute_ppt">
                <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://10.32.80.11:8889/event/Vdm/ControlRouter"/>
            </port>
            <port name="__esb_ControlRouter_execute_ppt" binding="tns:__esb_ControlRouter_execute_ppt">
            </port>
        </service>
        <plt:partnerLinkType name="execute_pptLT">
            <plt:role name="execute_pptProvider">
    
                <plt:portType name="tns:execute_ppt"/>
            </plt:role>
        </plt:partnerLinkType>
    </definitions>
    Imported WSDL:
    Code:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <definitions name="ControlRouter" targetNamespace="http://oracle.com/esb/namespaces/Vdm" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://oracle.com/esb/namespaces/Vdm" xmlns:inp1="http://www.edmunds.com/vehicle/publish/control">
        <types>
          <schema xmlns="http://www.w3.org/2001/XMLSchema">
            <import namespace="http://www.edmunds.com/vehicle/publish/control" schemaLocation="vehicle-publish-control.xsd"/>
          </schema>
        </types>
        <message name="vehicle-publish-control_request">
            <part name="vehicle-publish-control" element="inp1:vehicle-publish-control"/>
        </message>
    
        <portType name="execute_ppt">
            <operation name="execute">
                <input message="tns:vehicle-publish-control_request"/>
            </operation>
        </portType>
    </definitions>

  • #2
    Any Help?

    If anyone has any insight into why the Spring WebServiceTemplate would have issues communicating with a web service described above, etc it would be greatly appreciated!

    Thanks

    Comment


    • #3
      Figured it out!

      After looking at the HTTP MEssage headers using TCP/IP Monitor I saw that SOAP UI was placing a header called SOAPAction: "execute" in the HTTP Request so I used this method on the webservice template which allows you to set this header value manually:



      Code:
      webServiceTemplate.sendSourceAndReceive(webServiceTemplate.getDefaultUri(),source2, new WebServiceMessageCallback(){
      
                  public void doWithMessage(WebServiceMessage message) throws IOException, TransformerException {
      
                                  ((SoapMessage)message).setSoapAction("execute");
      
                  }
      
              }, new SourceExtractor(){
      
                  public Object extractData(Source source) throws IOException, TransformerException {
      
                      return null;  //To change body of implemented methods use File | Settings | File Templates.
      
                  }
      
              });

      Comment

      Working...
      X