Hi Die,

You need to engage addressing to use the To header to send using implicit
parameters inside synapse. So in effect you need to engage addressing. Can
you please send your client side axis2.xml configuration. There seems
something wrong with the client side of axis2.

I am sorry both SOAPHeader and the SOAPHeaderBlock are the same.

Thanks,
Ruwan

On Jan 16, 2008 3:28 PM, Die j999 <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> it is a client generated with WSDL2java script distribuited with 
> Axis2-1.3standard binary distribution.
> This is the code:
>
>
> package samples.quickstart.clients;
>
>
>
> import org.apache.axiom.om.OMAbstractFactory;
>
> import org.apache.axiom.om.OMElement;
>
> import org.apache.axiom.om.OMFactory;
>
> import org.apache.axiom.om.OMNamespace;
>
> import org.apache.axis2.Constants;
>
> import org.apache.axis2.addressing.EndpointReference;
>
> import org.apache.axis2.client.Options;
>
> import org.apache.axis2.client.ServiceClient;
>
>
>
> public class AXIOMClient {
>
>
>
>    private static EndpointReference targetEPR =
>
>        new EndpointReference(
>
>                              "
> http://localhost:8080/axis2/services/StockQuoteService";);
>
>
>
>    public static OMElement getPricePayload(String symbol) {
>
>        OMFactory fac = OMAbstractFactory.getOMFactory();
>
>        OMNamespace omNs = fac.createOMNamespace(
>
>                                                 "
> http://quickstart.samples/xsd";, "tns");
>
>
>
>        OMElement method = fac.createOMElement("getPrice", omNs);
>
>        OMElement value = fac.createOMElement("symbol", omNs);
>
>        value.addChild(fac.createOMText(value, symbol));
>
>        method.addChild(value);
>
>        return method;
>
>    }
>
>
>
>    public static OMElement updatePayload(String symbol, double price) {
>
>        OMFactory fac = OMAbstractFactory.getOMFactory();
>
>        OMNamespace omNs = fac.createOMNamespace(
>
>                                                 "
> http://quickstart.samples/xsd";, "tns");
>
>
>
>        OMElement method = fac.createOMElement("update", omNs);
>
>
>
>        OMElement value1 = fac.createOMElement("symbol", omNs);
>
>        value1.addChild(fac.createOMText(value1, symbol));
>
>        method.addChild(value1);
>
>
>
>        OMElement value2 = fac.createOMElement("price", omNs);
>
>        value2.addChild(fac.createOMText(value2,
>
>                                         Double.toString(price)));
>
>        method.addChild(value2);
>
>        return method;
>
>    }
>
>
>
>    public static void main(String[] args) {
>
>        try {
>
>            OMElement getPricePayload = getPricePayload("WSO");
>
>            OMElement updatePayload = updatePayload("WSO", 123.42);
>
>            Options options = new Options();
>
>            options.setTo(targetEPR);
>
>            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>
>            options.setProperty(Constants.Configuration.TRANSPORT_URL, "
> http://192.168.2.1:8080";);
>
>
>            ServiceClient sender = new ServiceClient();
>
>            sender.setOptions(options);
>
>
>
>            sender.fireAndForget(updatePayload);
>
>            System.err.println("price updated");
>
>            Thread.sleep(3000);
>
>            OMElement result = sender.sendReceive(getPricePayload);
>
>
>
>            String response = result.getFirstElement().getText();
>
>            System.err.println("Current price of WSO: " + response);
>
>
>
>        } catch (Exception e) {
>
>            e.printStackTrace();
>
>        }
>
>    }
>
>
>
> }
>
> When i run the client, Synapse show this message:
>
> 2008-01-16 10:49:30,678 [127.0.0.1-debianDesk] [HttpServerWorker-2] DEBUG
> SendMediator Sending request message using implicit message properties..
> Sending To: /
> SOAPAction: urn:anonOutInOp
> 2008-01-16 10:49:30,679 [127.0.0.1-debianDesk] [HttpServerWorker-2] DEBUG
> Axis2FlexibleMEPClient Sending [add = false] [sec = false] [rm = false] [ to
> Address: /]
> 2008-01-16 10:49:30,679 [127.0.0.1-debianDesk] [HttpServerWorker-2] ERROR
> Axis2Sender Unexpected error during sending message out
> org.apache.axis2.AxisFault: The system cannot infer the transport
> information from the / URL.
>        at org.apache.axis2.description.ClientUtils.inferOutTransport(
> ClientUtils.java:73)
>        at
> org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl
> (DynamicAxisOperation.java:118)
>        at org.apache.axis2.client.OperationClient.execute(
> OperationClient.java:163)
>        at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(
> Axis2FlexibleMEPClient.java:248)
>        at org.apache.synapse.core.axis2.Axis2Sender.sendOn(
> Axis2Sender.java:55)
>        at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(
> Axis2SynapseEnvironment.java:165)
>        at org.apache.synapse.mediators.builtin.SendMediator.mediate(
> SendMediator.java:97)
>        at org.apache.synapse.mediators.AbstractListMediator.mediate(
> AbstractListMediator.java:60)
>        at org.apache.synapse.mediators.base.SequenceMediator.mediate(
> SequenceMediator.java:121)
>        at
> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(
> Axis2SynapseEnvironment.java:118)
>        at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(
> SynapseMessageReceiver.java:89)
>        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
>        at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:275)
>        at org.apache.axis2.transport.nhttp.ServerWorker.processPost(
> ServerWorker.java:210)
>        at org.apache.axis2.transport.nhttp.ServerWorker.run(
> ServerWorker.java:174)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> ThreadPoolExecutor.java:650)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:675)
>        at java.lang.Thread.run(Thread.java:595)
>
> 1) Synapse is not enable to understand the destination of the message.
>
> 2) What is the different between Soap Header and Soap Header BLock?
>
> ----------------------------------------
> > Date: Wed, 16 Jan 2008 14:50:18 +0530
> > From: [EMAIL PROTECTED]
> > To: [email protected]
> > Subject: Re: Soap headers
> >
> > Hi Die,
> >
> > Can you please let us know what is the client that you have used to
> invoke
> > the service. Is that an java client (if so is that an written one or
> > generated client?) or any other program which generates the request and
> send
> > to the service?
> >
> > AFAIK, it is not required to have a SOAP header to invoke a service, but
> it
> > seems like the client that you are using is not adding the soap header
> > block.
> >
> > Thanks,
> > Ruwan
> >
> > On Jan 16, 2008 2:39 PM, Die j999  wrote:
> >
> >>
> >> Hi,
> >>
> >> i make a simple web service but when i run the client the soap message
> >> don't have the soap header, so i engage the addressing module in the
> client
> >> side but i have the following error:
> >>
> >>  [java] org.apache.axis2.AxisFault: The server failed to process the
> >> WS-Addressing header: wsa:Action [Reason]: A header representing a
> Message
> >> Addressing Property is not valid and the message cannot be processed
> >>     [java]     at
> >> org.apache.axis2.handlers.addressing.AddressingInFaultHandler.invoke(
> >> AddressingInFaultHandler.java:114)
> >>     [java]     at org.apache.axis2.engine.Phase.invoke(Phase.java:292)
> >>     [java]     at org.apache.axis2.engine.AxisEngine.invoke(
> >> AxisEngine.java:212)
> >>     [java]     at org.apache.axis2.engine.AxisEngine.receive(
> >> AxisEngine.java:132)
> >>     [java]     at
> >> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(
> >> OutInAxisOperation.java:336)
> >>     [java]     at
> >> org.apache.axis2.description.OutInAxisOperationClient.send(
> >> OutInAxisOperation.java:389)
> >>     [java]     at
> >> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
> >> OutInAxisOperation.java:211)
> >>     [java]     at org.apache.axis2.client.OperationClient.execute(
> >> OperationClient.java:163)
> >>     [java]     at org.apache.axis2.client.ServiceClient.sendReceive(
> >> ServiceClient.java:528)
> >>     [java]     at org.apache.axis2.client.ServiceClient.sendReceive(
> >> ServiceClient.java:508)
> >>     [java]     at samples.quickstart.clients.AXIOMClient.main(
> >> AXIOMClient.java:139)
> >>     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> Method)
> >>     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(
> >> NativeMethodAccessorImpl.java:39)
> >>     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> >> DelegatingMethodAccessorImpl.java:25)
> >>     [java]     at java.lang.reflect.Method.invoke(Method.java:585)
> >>     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.run(
> >> ExecuteJava.java:202)
> >>     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(
> >> ExecuteJava.java:134)
> >>     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
> >>     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(
> Java.java
> >> :178)
> >>     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java
> :84)
> >>     [java]     at org.apache.tools.ant.UnknownElement.execute(
> >> UnknownElement.java:275)
> >>     [java]     at org.apache.tools.ant.Task.perform(Task.java:364)
> >>     [java]     at org.apache.tools.ant.Target.execute(Target.java:341)
> >>     [java]     at org.apache.tools.ant.Target.performTasks(Target.java
> >> :369)
> >>     [java]     at org.apache.tools.ant.Project.executeSortedTargets(
> >> Project.java:1216)
> >>     [java]     at org.apache.tools.ant.Project.executeTarget(
> Project.java
> >> :1185)
> >>     [java]     at
> >> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(
> >> DefaultExecutor.java:40)
> >>     [java]     at org.apache.tools.ant.Project.executeTargets(
> Project.java
> >> :1068)
> >>     [java]     at org.apache.tools.ant.Main.runBuild(Main.java:668)
> >>     [java]     at org.apache.tools.ant.Main.startAnt(Main.java:187)
> >>     [java]     at org.apache.tools.ant.launch.Launcher.run(
> Launcher.java
> >> :246)
> >>     [java]     at org.apache.tools.ant.launch.Launcher.main(
> Launcher.java
> >> :67)
> >>
> >> Please let me know what could be wrong.
> >>
> >> Thanks
> >>
> >> Diego S.
> >>
> >>
> >> _________________________________________________________________
> >> Conosci Doretta? Contattala, รจ ora su Messenger!
> >> http://www.doretta82.it/banner/index.html
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > Ruwan Linton
> > http://www.wso2.org - "Oxygenating the Web Services Platform"
>
> _________________________________________________________________
> Organizza le tue feste e condividine le foto con Windows Live Eventi!
> http://home.services.spaces.live.com/events/
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

Reply via email to