Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

SOAP Action

Thread view: 
DougJrs - 10 Apr 2007 23:26 GMT
Good Afternoon Everyone!

I am having a little problem setting the SOAP action in my program. I
am setting the "SOAPACTION_USE_PROPERTY" and the
"SOAPACTION_URI_PROPERTY" properties, but they do not seem to be
working.

An example of the message that is being created and of my code is
below.  Any help is greatly appericated.

Thanks,
Doug

Here is the SOAP Message that my code (below) is creating:
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related,
text/*
User-Agent: Axis/1.4
Host: staging.brassring.com
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1961

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelop ....

Here is the code that I am using:
   public void call(String endpointUrl, String queryFileName) throws
Exception{

       Category cat = Category.getRoot();
        cat.debug("This is the call functions");
       Service service = new Service();
       Call call = (Call) service.createCall();
        call.setProperty("SOAPACTION_USE_PROPERTY", Boolean.TRUE);
        call.setProperty("SOAPACTION_URI_PROPERTY", "http://
Host.WebServices.SSO/Login");
       call.setTargetEndpointAddress( new
java.net.URL(endpointUrl) );

       SOAPBodyElement[] input = new SOAPBodyElement[1];
       Element inputQuery = buildInputQuery(queryFileName);
       input[0] = new SOAPBodyElement(inputQuery);

       cat.debug(">> calling SOAP service at: " + endpointUrl);
       cat.debug(">> QUERY: ");
       this.writeDOMDocument(inputQuery.getOwnerDocument(),
System.out);

       Vector elems = (Vector) call.invoke( input );
       SOAPBodyElement elem = (SOAPBodyElement) elems.get(0);
       Element responseElement = elem.getAsDOM();

       cat.debug(">> RESPONSE: ");
       this.writeDOMDocument(responseElement.getOwnerDocument(),
System.out);
       cat.debug("\n>> Exiting");
   }
DougJrs - 11 Apr 2007 19:08 GMT
Hi All!

I modified my code to this:

Service service = new Service();
Call call = (Call) service.createCall();
        call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
        call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://
WebServices.SSO/Login");
       call.setTargetEndpointAddress( new
java.net.URL(endpointUrl) );

And it is working.  Hope this helps someone else!!

Doug


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.