You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Nasreen Laghari <la...@hotmail.com> on 2007/10/01 01:50:19 UTC
RE: EPR...Endpoint Reference
Hi,
I'm still having the same problem of Address not found. I also tried to look in mail Archive but I couldn't resolve it. I got 2 reply from mailing list, 1 said that it looks like service is not available but I can see my webservice working on http://localhost:8080/axis2. The other said it might be the problem of SOAP and he recommended me to use TCPMon. For this I need to ask how do we know which version of SOAP we are using? and following is the result of TCPMon. I have also attached Service.xml and jsp client.
POST /axis2/services/AutenticationServer HTTP/1.1Content-Type: text/xml; charset=UTF-8SOAPAction: "urn:anonOutInOp"User-Agent: Axis2Host: localhost:8082Transfer-Encoding: chunked
fc<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:getVersion xmlns:ns1="http://axisversion.sample/xsd"><ns1:myValue /></ns1:getVersion></soapenv:Body></soapenv:Envelope>0
..................
HTTP/1.1 200 OKServer: Apache-Coyote/1.1Content-Type: text/html;charset=ISO-8859-1Content-Length: 242Date: Sun, 30 Sep 2007 23:19:55 GMT
Exception: The endpoint reference (EPR) for the Operation not found is http://localhost:8082/axis2/services/AutenticationServer and the WSA Action = urn:anonOutInOp
<HTML><BODY>
ABC12
</BODY>
</HTML>
> Date: Tue, 25 Sep 2007 12:11:58 -0500> From: soloto@lidp.com> To: axis-user@ws.apache.org> Subject: Re: EPR...Endpoint Reference> > The Exception says that you do not have a service defined for "Random".> Make sure that Random is correctly defined.> > > On Tue, Sep 25, 2007 at 10:02:27AM -0700, Linus Kamb wrote:> > Not sure if this is your trouble, but I had similar troubles.> > > > Look at: http://marc.info/?l=axis-user&m=118954790931434&w=2> > > > use TCPMON to see what your http headers look like (as well as the SOAP > > message.)> > > > Linus> > > > > > Nasreen Laghari wrote:> > >Hi> > > > > >Why EPR operation is not found?> > > > > > > > >Exception: The endpoint reference (EPR) for the Operation not found is > > >http://localhost:8080/axis2/services/Random and the WSA Action = > > >urn:anonOutInOp> > > > > > > > > > > >My Coding:> > > > > ><%@ page import="org.apache.axiom.om.OMAbstractFactory,> > > org.apache.axiom.om.OMElement,> > > org.apache.axiom.om.OMFactory,> > > org.apache.axiom.om.OMNamespace,> > > org.apache.axis2.AxisFault,> > > org.apache.axis2.Constants,> > > org.apache.axis2.addressing.EndpointReference,> > > org.apache.axis2.client.Options,> > > org.apache.axis2.client.ServiceClient,> > > org.apache.axis2.context.ConfigurationContext,> > > org.apache.axis2.context.ConfigurationContextFactory" %>> > > > > ><%! private OMElement createEnvelope() {> > > OMFactory fac = OMAbstractFactory.getOMFactory();> > > OMNamespace omNs = > > >fac.createOMNamespace("http://axisversion.sample/xsd", "ns1");> > > OMElement method = fac.createOMElement("getVersion", omNs);> > > OMElement value = fac.createOMElement("myValue", omNs);> > > method.addChild(value);> > > return method;> > > }> > >%>> > ><%> > > String IP = "http://localhost:8080/axis2/axis2-web/trial.jsp";> > > int lastindex = IP.lastIndexOf('/');> > > IP = IP.substring(0, lastindex);> > > ///axis2/axis2-web/services/version> > > IP = IP.replaceAll("axis2-web", "");> > >%>> > ><% try{> > > OMElement payload = createEnvelope();> > > ConfigurationContext configctx = > > >ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, > > >null);> > > ServiceClient client = new ServiceClient(configctx, null);> > > EndpointReference targetEPR = new EndpointReference(IP + > > >configctx.getServicePath() + "/Random");> > > > > > Options options = new Options();> > > client.setOptions(options);> > > options.setTo(targetEPR);> > > options.setTransportInProtocol(Constants.TRANSPORT_HTTP);> > > OMElement result = client.sendReceive(payload);> > > out.println("Result: " +result);> > >> > > > > > } catch (Exception e) {> > > out.println("Exception: "+e.getMessage());> > > }> > >%>> > >> > ---------------------------------------------------------------------> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org> For additional commands, e-mail: axis-user-help@ws.apache.org>
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
Re: EPR...Endpoint Reference
Posted by Linus Kamb <li...@iris.washington.edu>.
It seems you are using SOAP 1.1
But that does not seem to be the real problem.
What service and operation are you intending to call?
It would appear you are calling the getVersion() operation of the
AuthenticationServer service. If that is not correct, then you need to
look at the target endpoint url you are crafting or the content of the
message you are sending.
If that *is* correct, then I suspect you need to get the SOAPAction:
header to match the soapAction that is specified in the wsdl binding.
For example, I have a binding that looks like:
<wsdl:binding name="MetadataSOAP11Binding" type="meta:MetadataPort">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="version">
<soap:operation soapAction="urn:version" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
not the soapAction="urn:version" attribute on the soap:operation element.
org.apache.axis2.client.Options.setAction() might help here.
I've never done this, so I'm guessing.
Linus
Nasreen Laghari wrote:
> Hi,
>
> I'm still having the same problem of Address not found. I also tried
> to look in mail Archive but I couldn't resolve it. I got 2 reply from
> mailing list, 1 said that it looks like service is not available but I
> can see my webservice working on http://localhost:8080/axis2. The
> other said it might be the problem of SOAP and he recommended me to
> use TCPMon. For this I need to ask how do we know which version of
> SOAP we are using? and following is the result of TCPMon. I have also
> attached Service.xml and jsp client.
>
> POST /axis2/services/AutenticationServer HTTP/1.1
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "urn:anonOutInOp"
> User-Agent: Axis2
> Host: localhost:8082
> Transfer-Encoding: chunked
> fc
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:getVersion
> <http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoapenv:Body%3E%3Cns1:getVersion>
> xmlns:ns1="http://axisversion.sample/xsd"><ns1:myValue
> <http://axisversion.sample/xsd%22%3E%3Cns1:myValue>
> /></ns1:getVersion></soapenv:Body></soapenv:Envelope>
> 0
>
>
> ..................
>
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Content-Type: text/html;charset=ISO-8859-1
> Content-Length: 242
> Date: Sun, 30 Sep 2007 23:19:55 GMT
>
>
> Exception: The endpoint reference (EPR) for the Operation not found is
> http://localhost:8082/axis2/services/AutenticationServer and the WSA
> Action = urn:anonOutInOp
>
>
> <HTML>
> <BODY>
> ABC12
>
> </BODY>
> </HTML>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> > Date: Tue, 25 Sep 2007 12:11:58 -0500
> > From: soloto@lidp.com
> > To: axis-user@ws.apache.org
> > Subject: Re: EPR...Endpoint Reference
> >
> > The Exception says that you do not have a service defined for "Random".
> > Make sure that Random is correctly defined.
> >
> >
> > On Tue, Sep 25, 2007 at 10:02:27AM -0700, Linus Kamb wrote:
> > > Not sure if this is your trouble, but I had similar troubles.
> > >
> > > Look at: http://marc.info/?l=axis-user&m=118954790931434&w=2
> > >
> > > use TCPMON to see what your http headers look like (as well as the
> SOAP
> > > message.)
> > >
> > > Linus
> > >
> > >
> > > Nasreen Laghari wrote:
> > > >Hi
> > > >
> > > >Why EPR operation is not found?
> > > >
> > > >
> > > >Exception: The endpoint reference (EPR) for the Operation not
> found is
> > > >http://localhost:8080/axis2/services/Random and the WSA Action =
> > > >urn:anonOutInOp
> > > >
> > > >
> > > >
> > > >My Coding:
> > > >
> > > ><%@ page import="org.apache.axiom.om.OMAbstractFactory,
> > > > org.apache.axiom.om.OMElement,
> > > > org.apache.axiom.om.OMFactory,
> > > > org.apache.axiom.om.OMNamespace,
> > > > org.apache.axis2.AxisFault,
> > > > org.apache.axis2.Constants,
> > > > org.apache.axis2.addressing.EndpointReference,
> > > > org.apache.axis2.client.Options,
> > > > org.apache.axis2.client.ServiceClient,
> > > > org.apache.axis2.context.ConfigurationContext,
> > > > org.apache.axis2.context.ConfigurationContextFactory" %>
> > > >
> > > ><%! private OMElement createEnvelope() {
> > > > OMFactory fac = OMAbstractFactory.getOMFactory();
> > > > OMNamespace omNs =
> > > >fac.createOMNamespace("http://axisversion.sample/xsd", "ns1");
> > > > OMElement method = fac.createOMElement("getVersion", omNs);
> > > > OMElement value = fac.createOMElement("myValue", omNs);
> > > > method.addChild(value);
> > > > return method;
> > > > }
> > > >%>
> > > ><%
> > > > String IP = "http://localhost:8080/axis2/axis2-web/trial.jsp";
> > > > int lastindex = IP.lastIndexOf('/');
> > > > IP = IP.substring(0, lastindex);
> > > > ///axis2/axis2-web/services/version
> > > > IP = IP.replaceAll("axis2-web", "");
> > > >%>
> > > ><% try{
> > > > OMElement payload = createEnvelope();
> > > > ConfigurationContext configctx =
> > >
> >ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
>
> > > >null);
> > > > ServiceClient client = new ServiceClient(configctx, null);
> > > > EndpointReference targetEPR = new EndpointReference(IP +
> > > >configctx.getServicePath() + "/Random");
> > > >
> > > > Options options = new Options();
> > > > client.setOptions(options);
> > > > options.setTo(targetEPR);
> > > > options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
> > > > OMElement result = client.sendReceive(payload);
> > > > out.println("Result: " +result);
> > > >
> > > >
> > > > } catch (Exception e) {
> > > > out.println("Exception: "+e.getMessage());
> > > > }
> > > >%>
> > > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
>
> ------------------------------------------------------------------------
> Get news, entertainment and everything you care about at Live.com.
> Check it out! <http://www.live.com/getstarted.aspx%20>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: EPR...Endpoint Reference
Posted by "Merritt, Norris" <no...@hp.com>.
To tell the version of SOAP from a trace like this, examine the
Content-Type header value and/or the SOAP namespace declaration in the
body of the message.
For SOAP 1.2, the Content-Type is application/soap+xml whereas for SOAP
1.1, the content type is text/xml (unless the soap message has
attachments, which is another story altogether)
For SOAP 1.2, the namespace declaration should be
http://www.w3.org/2003/05/soap-envelope
<http://www.w3.org/2003/05/soap-envelope> , whereas for SOAP 1.1 it
should be http://schemas.xmlsoap.org/soap/envelope/
________________________________
From: Nasreen Laghari [mailto:lagharinasreen@hotmail.com]
Sent: Sunday, September 30, 2007 4:50 PM
To: axis-user@ws.apache.org; deepalk@gmail.com; soloto@lidp.com
Subject: RE: EPR...Endpoint Reference
Hi,
I'm still having the same problem of Address not found. I also tried to
look in mail Archive but I couldn't resolve it. I got 2 reply from
mailing list, 1 said that it looks like service is not available but I
can see my webservice working on http://localhost:8080/axis2. The other
said it might be the problem of SOAP and he recommended me to use
TCPMon. For this I need to ask how do we know which version of SOAP we
are using? and following is the result of TCPMon. I have also attached
Service.xml and jsp client.
POST /axis2/services/AutenticationServer HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:anonOutInOp"
User-Agent: Axis2
Host: localhost:8082
Transfer-Encoding: chunked
fc
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body>
<ns1:getVersion <http://schemas.xmlsoap.org/soap/envelope/>
xmlns:ns1="http://axisversion.sample/xsd"><ns1:myValue
<http://axisversion.sample/xsd>
/></ns1:getVersion></soapenv:Body></soapenv:Envelope>
0
..................
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 242
Date: Sun, 30 Sep 2007 23:19:55 GMT
Exception: The endpoint reference (EPR) for the Operation not found is
http://localhost:8082/axis2/services/AutenticationServer and the WSA
Action = urn:anonOutInOp
<HTML>
<BODY>
ABC12
</BODY>
</HTML>
________________________________
> Date: Tue, 25 Sep 2007 12:11:58 -0500
> From: soloto@lidp.com
> To: axis-user@ws.apache.org
> Subject: Re: EPR...Endpoint Reference
>
> The Exception says that you do not have a service defined for
"Random".
> Make sure that Random is correctly defined.
>
>
> On Tue, Sep 25, 2007 at 10:02:27AM -0700, Linus Kamb wrote:
> > Not sure if this is your trouble, but I had similar troubles.
> >
> > Look at: http://marc.info/?l=axis-user&m=118954790931434&w=2
> >
> > use TCPMON to see what your http headers look like (as well as the
SOAP
> > message.)
> >
> > Linus
> >
> >
> > Nasreen Laghari wrote:
> > >Hi
> > >
> > >Why EPR operation is not found?
> > >
> > >
> > >Exception: The endpoint reference (EPR) for the Operation not found
is
> > >http://localhost:8080/axis2/services/Random and the WSA Action =
> > >urn:anonOutInOp
> > >
> > >
> > >
> > >My Coding:
> > >
> > ><%@ page import="org.apache.axiom.om.OMAbstractFactory,
> > > org.apache.axiom.om.OMElement,
> > > org.apache.axiom.om.OMFactory,
> > > org.apache.axiom.om.OMNamespace,
> > > org.apache.axis2.AxisFault,
> > > org.apache.axis2.Constants,
> > > org.apache.axis2.addressing.EndpointReference,
> > > org.apache.axis2.client.Options,
> > > org.apache.axis2.client.ServiceClient,
> > > org.apache.axis2.context.ConfigurationContext,
> > > org.apache.axis2.context.ConfigurationContextFactory" %>
> > >
> > ><%! private OMElement createEnvelope() {
> > > OMFactory fac = OMAbstractFactory.getOMFactory();
> > > OMNamespace omNs =
> > >fac.createOMNamespace("http://axisversion.sample/xsd", "ns1");
> > > OMElement method = fac.createOMElement("getVersion", omNs);
> > > OMElement value = fac.createOMElement("myValue", omNs);
> > > method.addChild(value);
> > > return method;
> > > }
> > >%>
> > ><%
> > > String IP = "http://localhost:8080/axis2/axis2-web/trial.jsp";
> > > int lastindex = IP.lastIndexOf('/');
> > > IP = IP.substring(0, lastindex);
> > > ///axis2/axis2-web/services/version
> > > IP = IP.replaceAll("axis2-web", "");
> > >%>
> > ><% try{
> > > OMElement payload = createEnvelope();
> > > ConfigurationContext configctx =
> >
>ConfigurationContextFactory.createConfigurationContextFromFileSystem(nu
ll,
> > >null);
> > > ServiceClient client = new ServiceClient(configctx, null);
> > > EndpointReference targetEPR = new EndpointReference(IP +
> > >configctx.getServicePath() + "/Random");
> > >
> > > Options options = new Options();
> > > client.setOptions(options);
> > > options.setTo(targetEPR);
> > > options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
> > > OMElement result = client.sendReceive(payload);
> > > out.println("Result: " +result);
> > >
> > >
> > > } catch (Exception e) {
> > > out.println("Exception: "+e.getMessage());
> > > }
> > >%>
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
________________________________
Get news, entertainment and everything you care about at Live.com. Check
it out! <http://www.live.com/getstarted.aspx%20>