JAX-WS: How to set headers on generated client?

Hello
Im trying to build a client to consume the web service defined here: http://my.hot-sos.net/HTNGListener/HTNGListener.asmx?WSDL
I've use the wsimport tool to generate the classes and one of the services (ping) works fine.
The other servcies, however, are giving me this error:
javax.xml.ws.soap.SOAPFaultException: Server was unable to process request. ---> No HTNG Header found in Soap Header
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(Unknown Source)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at $Proxy30.receiveMessageSync(Unknown Source)
at com.pogo.test.HelloWorldClient.main(HelloWorldClient.java:29)I think the problem is that the service expects a header. The generated code has a HTNGHeader factory but I cant find a method where to add this header to the request.
<wsdl:operation name="ReceiveMessageSync">
<soap12:operation soapAction="http://htng.org/1.1/Listener.Wsdl#ReceiveMessageSync" style="document" soapActionRequired="true" />
<wsdl:input>
<soap12:body use="literal" />
<soap12:header message="tns:ReceiveMessageSyncHTNGHeader" part="HTNGHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
<soap12:header message="tns:ReceiveMessageSyncHTNGHeader" part="HTNGHeader" use="literal" />
</wsdl:output>
</wsdl:operation>This is how Im trying to invoke:
HTNGListener listener = new HTNGListener();
HTNGListenerSoap stub = listener.getHTNGListenerSoap();
stub.ping();
org.htng._1_1.header.ObjectFactory headerOF = new org.htng._1_1.header.ObjectFactory();
HTNGHeader header = headerOF.createHTNGHeader();
header.setTimeStamp(DatatypeFactory.newInstance().newXMLGregorianCalendar() );
//I've created the header, but dont know how to set it.
String request = "<GetMessages/>";
System.out.println(stub.receiveMessageSync(request));Any advise is more than welcome.
Thanks
Gonso

How are you even getting the WSDL to parse? I get:
parsing WSDL...
[ERROR] Non unique body parts! In a port, operations must have unique operation signaure on the wire for successful dispatch. In port HTNGListenerSoap, Operations "ReceiveMessageAsync" and "ReceiveMessageSync" have the same request body block {http://htng.org/1.1/Listener.Wsdl}Request
  line 150 of http://my.hot-sos.net/HTNGListener/HTNGListener.asmx?WSDL

Similar Messages

  • How to set registry for sql client on win...

    Hi.
    how to set registry for sql client on win fro work with Ukranine
    charset.
    I got such problem
    nls_language set to American_Ukranine.clmswin1251 on client
    this give me ukraniane char.
    but it override all my settings in initsid.ora this mean
    nls_date_format=DD-MON-YYYY
    nls_date_languages
    twhen I type select sysdate vrom dual answer is 11-jun-99, but
    not 11-(ukr month)-1999;
    What should I correct in regestry? ( i don't like to do alter
    session set..... each time I start sqlplus )
    Thank You in advice
    null

    you can create method on Application Module and to Client listener
    like
        public  Object[] getData(Number n,Date d)
    Object val[]= new Object[2];
    String sp = "{? = call get_data(?,?,?)}";
                Connection conn = null;
                CallableStatement proc = null;
                try {
                 //   conn = isConnSupplied ? userConn : ResourceManager.getConnection();
                    proc = getDBTransaction().createCallableStatement(sp,0);
                proc.registerOutParameter(1, OracleTypes.Number);
                proc.setObject(2,12);
               proc.setObject(3,dateobj);
              proc.registerOutParameter(2, OracleTypes.VARCHAR);
                proc.executeQuery();
                 int amttext= proc.getInt(1); //for return value
    String msg=proc.getString(2);//for out param
    val[0]=amttext;
    val[1]=msg;
                catch(Exception e)
                    System.out.println(e);
    return val;
    }and access this method from backing bean using following code-
                BindingContext bindingctx=BindingContext.getCurrent();
                   BindingContainer binding=bindingctx.getCurrentBindingsEntry();
                OperationBinding operationBinding1 = binding.getOperationBinding("getData");
                operationBinding1.getParamsMap().put("n",anyno);
                operationBinding1.getParamsMap().put("d",dateobj);
                operationBinding1.execute();
                String vval[] =(String[])operationBinding1.getResult();

  • How to set default SQL Native Client in SAP BO?

    Hello,
    is there any possibility to set default SQL Native Client? We must have two SQL NC installed unfortunately, 2005 and 2008. Issue is, that SAP BO chooses the 2008 by default and user must manually switch to 2005 to see pre-defined instances. Is there any way how to select SQL NC 2005 as default? Many thanks
    Best regards,
    Joe

    Hi,
    Try this procedures.
    1. Dont open your SBO program.
    2. Goto C:\Program Files\SAP\SAP Business One\Conf\ folder
    3. Delete file b1-local-machine.xml
    4. Log to SBO program.
    5. Apply all necessary authentication then select SQL_2008 then log.
    6. After logging exit to SBO program.
    7. Re-log again if SQL_2008 is already in default.
    Thanks.
    Clint

  • Use wscompile to set properties in generated client.

    It seems to me that there should be an easy way to set properties in generated code.
    My client code generates properly, for instance:
            try {
                stub._initialize(super.internalTypeRegistry);
            } catch (JAXRPCException e) {
                throw e;
            } catch (Exception e) {
                throw new JAXRPCException(e.getMessage(), e);
            }      However, at this point, I am now having to insert the properties for user/pass (basic authentication) by hand.
            try {
                stub._initialize(super.internalTypeRegistry);
                stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"any user");
                stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"any password");
            } catch (JAXRPCException e) {
                throw e;
            } catch (Exception e) {
                throw new JAXRPCException(e.getMessage(), e);
            }Simple enough.
    Has anyone done this automatically, using wscompile? Manually changing generated code just seems like bad form to me.
    Thanks,
    DaShaun

    Ok, don't do what I tried to do. Very bad form, my apologies. Instead of adding the authentication code to the generated classes, I should have been adding it to my client code.
    Each client then needs to authenticate itself. My approach would have allowed any client to use the code and be authenticated as 'any user'. This is not good.
    DaShaun

  • How to set commandtimeout for oracle client

    Hi ,
    does anybody have an idea how to set the command timeout for ODP or MS managed oracle client for oracle.
    This property does not seem to be supported . Although there is property exposed for command time out it does not work for odp and for MS oracleclient it is not present at all. Could anyone provide a workaround for it.
    Thanks in advance.
    Rahmatullah

    You're looking for the VirtualBox forums. https://forums.virtualbox.org/
    This forum is for discussion of Oracle VM Server.

  • How to set headers?

    How can I set the SOAP envelope header from a client app?
    Thanks,
    John

    Hi John,
    Access to SOAP header elements, is not currently supported in WLS 6.1. If you are
    referring to how to do this in WLS 7.0, you do it using a Handler.
    I have attached a zip, that illustrates how to do SwA (SOAP with Attachments), using
    client-side and server-side handlers, in WLS 7.0. If you have access to the API docs
    for JAX-RPC, you should be able to modify the code in the zip to include SOAP Headers
    The attachment will be at the bottom of this post ;-)
    Regards,
    Mike Wooten
    "John Surnow" <[email protected]> wrote:
    >
    How can I set the SOAP envelope header from a client app?
    Thanks,
    John[attach.jar]

  • Does anyone know how to set the cloud generator to loop?

    I would like to use the cloud generator as a looping backgrounf, but cannot figure out how to make it loop. I'm hoping there is an easy fix, and that is the reason I can't find support on this elsewhere!

    Hi Jim - sorry this wasn't clear.
    I would like to create a loopable file using the cloud generator in Apple Motion 5. I know what is wonderful about this generator is that it is random, but I am hoping there is a setting that will allow the content to seamlessly loop. I am willing to attack this problem from another angle if necessary, but I cannot effectively create a loop by cross-fading.
    Thank you for your help.

  • How to set a sequence generator as a value

    When i am creating a new object in a table there is a unique id i want to keep to identify this object and I use sequence generator. I believe the command is DB_SEQ_PK.NEXTVAL, do i put this statement as a "SQL EXP" in the Source value for the specific variable i want to set it to? Please give me the right expression if i am wrong thank you.

    Raj,
    i tested it with the emp table the following way:
    Extend This Application
    A page or application component
    Component > Form > Table
    [selected EMP table, page 40, the rest default]
    Edit Page 40
    Edit Page Item P40_EMPNO
    Alternate source used: Only when current value is session state is null
    Source Type: SQL Query
    Source value or expression: SELECT CT_ID_SEQ.NEXTVAL FROM DUAL;
    Apply Changes
    Run Page
    [The empno field shows a value of 50]
    [I enter 'test' into the ename field and click 'Create']
    [I receive the error: ORA-01400: cannot insert NULL into ("EAS"."EMP"."EMPNO")]
    I'm not sure what i am doing wrong here.
    Thanks

  • How to set headers, footers, and margins in pages?

    I'm using the pages app to write a paper. An I want to set my headers, footers, and margins to 0. So that way they won't show in my Microsoft word. Can anyone help me with that? I'm also blind an I use voiceover. So I would need step by step instructions on what to do. Thank u.

    You can create left and right single quotes with option + }, and shift + option + }, respectively.
    Double quotes work the same way using the { character substituted above.
    Menu > Format > Font > Baseline:
    Superscript is control + command and +
    Subscript is control + command and -

  • How to set executeThreadCount on the client side in WLS 6.0 SP1

    In WLS 5.1, you can set executeThreadCount on client side by using "java -Dweblogic.system.executeThreadCount=30
    clientProgram". What's the counter part in WLS 6.0? The qustion is strictly to
    CLIENT. I know how to configure executeThreadCount on server side. Thanks.
    Jim Zhou.

    In WLS 5.1, you can set executeThreadCount on client side by using "java -Dweblogic.system.executeThreadCount=30
    clientProgram". What's the counter part in WLS 6.0? The qustion is strictly to
    CLIENT. I know how to configure executeThreadCount on server side. Thanks.
    Jim Zhou.

  • How to set up WRT120N as client

    Hi,
    I have a wireless network which runs off a WRT610N router.  I want to set up a WRT120N router to act as a client "adapter" for a device that only has an ethernet connection.  I can connect the WRT120N router to the device OK but it cannot communicate with the rest of the wireless network.
    I have set the SSID and WAP security settings the same.
    Hope you can poing me in the right direction
    Rob
    Solved!
    Go to Solution.

    It is not possible.You need a wireless bridge (WET610N),which will communicate wirelessly to your router and then,you can connect your device/computer to the bridge hard-wired.If you need more ethernet port then,connect the switch to the bridge and then,your devices to the switch.

  • TS3276 . How to set a default email client

    I can't find a way to establish a default email client (I have 4) for Mail just upgraded to Mountain Lion. All help appreciated.
    George

    It seems that you have to set up Mail first, though!
    I'm using Thunderbird and would like to make it the default mail program, but it seems that I have to go through the entire process of setting up an account.  And, if I recall, sometimes mail programs will automatically download your messages-- which I wouldn't want Mail to do.
    So, gurus, what's the way around this?

  • Set headers for drill-down reports.

    Hi!!!
    The problem we have by now is when printing a report, selected characteristis are showed in header as "multiple values" instead of showing the real values that user have choose.
    Does anybody knows how to set headers for drill-down reports in order to see selected characteristics?
    Thanks in advance...
    Adela Cambiasso.

    Sorry, me again...
    I have found yet they way to show in the header the report parameters, I mean, the selection criterias that user used when execute the report... I was able to show selected characteristics inside de report but not the selection criteria...
    Do you know what I have lost? or what to use for this?
    Thanks again.
    Adela.

  • How to set the parameter of xi header in server proxy

    Hi,
    Does anyone have idea, how to set ref_to_message_id of a client proxy in the server proxy? My problem is, I send a message to a server proxy. The server proxy receives the message, retrieves the message id and tries to set the ref_to_message_id of the message, which will be sent to a client proxy, with its message id. I only find some useful functions to get these information of client proxy and server proxy like message_id etc. in runtime. But I did not find the "set" function to set these parameters. Maybe someone can tell me at first, if it is possible to set such parameters in runtime in server proxy.
    Can anyone help?
    regard
    hu

    Hi Chilla,
    what I want is to monitor the related message bundle easily. In my server proxy, many different client proxies are called and messages are transfered. So under the SXMB_MONI I will find many message exchanges for one server proxy call. Because the server proxy is called so often, I cannot distinguish under the SXMB_MONI, which message exchanges are caused by which server proxy call.
    So I have an idea. If I can set the ref_to_message_id of the messages for the client proxy calls with the message id of the server proxy call, then I can at first select the message of the server proxy call and find the messages for the related client proxy calls easily using the button "referencing message". The message id of the server proxy call can be retrieved. So my problem is now, how to set the ref_to_message_id of the messages for the client proxy calls with this messag id in the server proxy.
    Of cource, if anyone has better idea, how to resolve the situation in another way without setting the ref_to_message_id, pleases inform me.
    regards
    Bin

  • How to set ref_to_message_id in the abap proxy

    Hi,
    Does anyone have idea, how to set ref_to_message_id of a client proxy in the server proxy? My problem is, I send a message to a server proxy. The server proxy receives the message, retrieves the message id and tries to set the ref_to_message_id of the message, which will be sent to a client proxy, with its message id. Can anyone help?
    regard
    hu

    hi Bin,
    plz check this link it will be useful
    Re: Importance of Message ID in soap adapter
    How to retrieve file size and XI message ID?
    /people/michal.krawczyk2/blog/2005/02/25/simple-java-code-in-graphical-mapping--xi
    regards
    sasi
    <b>Reward if useful</b>

Maybe you are looking for

  • How can i  display output in the same selection screen?

    I've a requirement. Suppose in my selection screen there are three input fields. On the basis of this selection screens input It will  display the output in the same selection screen. Can it be possible? . Can it be possible to modify the default scr

  • From my own session how to find out the last SQL that I issued ?

    Why does the query bellow that would return the last sql issued only work on 10g version ? Notice the output: SQL> select * from v$version; BANNER Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production PL/SQL Release 9.2.0.5.0 - Production

  • How to autoextend tablespace in Oracle 9i

    Dear All, I have currenctly a tablespace ABC. Database is failing to writing. I want to alter tablespace ABC and want to make its AUTOEXTEND ON. Could any body please suggest the SQL Query how to do this. Regards,

  • JDeveloper 11.1.2.1.0 : The JUnit Integration update cannot be installed

    Hi. When trying to install "JUnit Integration 11.1.2.1.38.60.81" I got this message: "The JUnit Integration update cannot be installed because it has a required licence agreement that could not be read. Click Back to remove this update." I want to in

  • Excel sheet for difference between EP 6.0 and EP 7.0

    Hi All, Wish all of you a very very Happy New Year 2008. Can some body send the excel sheet for difference between EP 6.0 and EP 7.0 to [email protected] asap. Thanks in advance Jyoti