The endpoint reference (EPR) for the Operation not found is

前端 未结 14 825
生来不讨喜
生来不讨喜 2020-12-06 16:43

I have been struggling with the following error the last couple of days can you please help!

I generated my server and client code using the wsdl2java tool from a ws

相关标签:
14条回答
  • 2020-12-06 17:39

    Open WSDL file and find:

    <soap:operation soapAction="[actionNameIsHere]" style="document"/>
    

    Add to the requests header [request send to service]:

    'soapAction' : '[actionNameIsHere]'
    

    This work for me.

    For devs. using node-soap [ https://github.com/vpulim/node-soap ] - example:

    var soap = require('soap');
    var options = {
       ...your options...
       forceSoap12Headers: true
    }
    soap.createClient(
            wsdl, options,
                function(err, client) {
                    if(err) {
                        return callBack(err, result);
                    }
                    client.addHttpHeader('soapAction', '[actionNameIsHere]');
                    ...your code - request send...
                });
    
    0 讨论(0)
  • 2020-12-06 17:41

    Action is null means that no Action in given SOAP Message (Request XML). You must set Action before SOAP call:

    java.net.URL endpoint = new URL("<URL>"); //sets URL
    
    MimeHeaders headers = message.getMimeHeaders(); // getting MIME Header
    
    headers.addHeader("SOAPAction", "<SOAP Action>"); //add Action To Header
    
    SOAPMessage response = soapConnection.call(<SOAPMessage>, endpoint); //then Call
    
    soapConnection.close(); // then Close the connection
    
    0 讨论(0)
提交回复
热议问题