HTTPS ClassCastException for SOAPHttpsURLConnection to HttpsURLConnection

JDEV 11gR1PS1
Hi all,
I'm writing a Java class that posts via HTTPS. I'm getting the the following error when executing the class:
java.lang.ClassCastException: weblogic.net.http.SOAPHttpsURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection
using the following code (just a snip of what's relevant:
            url = new URL(nurl);
            connection = (HttpsURLConnection)url.openConnection();
            responseCode = connection.getResponseCode();I've also tried based on some research on the web
            url = new URL(null, nurl, new com.sun.net.ssl.internal.www.protocol.https.Handler());
            connection = (HttpsURLConnection)url.openConnection();
            responseCode = connection.getResponseCode();and instead I this error
java.lang.ClassCastException: com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl cannot be cast to javax.net.ssl.HttpsURLConnection
Ideas?

Import this instead
import weblogic.net.http.SOAPHttpsURLConnection;
and then when attempting the connection try using the SOAPHttpsURLConnection object

Similar Messages

  • Glassfish v3 ClassCastException for same class, at a List.get() command.

    Hello everyone,
    I am in the process of developing a small web application with JSF 2.0 and JPA, both of which I am not entirely familiar with. But thanks to Google and a lot of very dedicated experts, the Java and JSF forums have helped me with creating a basic form for entering and storing data. I am using Netbeans 6.8 which has glassfish V3 for the app server. However I have a problem where the auto-deploy in glass fish ends up giving me a ClassCastException for the same class, which after a bit of research on the net, seems to be a classloader problem.
    A related link http://72.5.124.102/thread.jspa?messageID=10119180 probably confirms the cause as a hot-deploy issue.
    My JSF page is created dynamically in the constructor of the managed bean, and it is here that I get the exception occasionally. A restart of the server solves the issue. Nevertheless, I would like to know if there is any other way to solve the classloader problem other than using a build.xml file as suggested in the forum link given above.
    I am posting a part of my code as well, so that if you think there a classloader problem in my code, you can let me know, so I can fix it.
    @ManagedBean(name = "CustomFields")
    @RequestScoped
    public class CustomFields {
        private String tableName;
        private List<UiSetup> dispFieldsList = new ArrayList();
        private HtmlPanelGrid customPanelSec = new HtmlPanelGrid();
        public HtmlPanelGrid getCustomPanelSec() {
            return customPanelSec;
        public void setCustomPanelSec(HtmlPanelGrid customPanelSec) {
            this.customPanelSec = customPanelSec;
        public String getTableName() {
            return tableName;
        public void setTableName(String tableName) {
            this.tableName = tableName;
        public CustomFields() {
            System.out.println("Invoked customFields backing bean");
            String callerBean = "";
            FacesContext context = FacesContext.getCurrentInstance();
            Application application = context.getApplication();
            tableName = context.getExternalContext().getRequestParameterMap().get("callerPage");
            callerBean = context.getExternalContext().getRequestParameterMap().get("backingBean");
            // This is a JPA contoller class for an entity that defines the custom fields that have to be enabled for this page.
            UiSetupJpaController fldsToShow = new UiSetupJpaController();
            dispFieldsList.clear();
            System.out.println("Did this1");
            // This function getDisplayFields gets the fields that have to be shown on the page.
            this.dispFieldsList = fldsToShow.getDisplayFields(tableName);
            System.out.println("Did this2");
            int totFields = this.dispFieldsList.size();
            System.out.println("Did this3");
            UiSetup us = this.dispFieldsList.get(totFields - 1);// This is where the error is thrown always.
            System.out.println("Did this4");
            customPanelSec.getChildren().clear();
            for (int i = 0; i < totFields; i++) {
                try {
                    HtmlPanelGrid fldLblGroup = new HtmlPanelGrid();
                    HtmlOutputLabel customLabel = (HtmlOutputLabel) application.createComponent(HtmlOutputLabel.COMPONENT_TYPE);
                    String labelName = dispFieldsList.get(i).getDisplayName();
                    customLabel.setValue(labelName);
                    String fieldName = dispFieldsList.get(i).getFieldName();
                    HtmlPanelGroup customField = (HtmlPanelGroup) application.createComponent(HtmlPanelGroup.COMPONENT_TYPE);
                    HtmlInputText customText = new HtmlInputText();
                    String valExp = "#{" + callerBean + "." + fieldName + "}";
                    customText.setId(fieldName);
                    customText.setValueExpression("value", createValueExpr(valExp, BigDecimal.class, context));
                    customField.getChildren().clear();
                    customField.getChildren().add(customText);
                    customPanelSec.getChildren().add(customLabel);
                    customPanelSec.getChildren().add(customField);
                }catch (Exception e) {
                    System.out.println(e.getMessage());
        private ValueExpression createValueExpr(String valexp, Class cls, FacesContext fcs) {
            return fcs.getApplication().getExpressionFactory().createValueExpression(fcs.getELContext(), valexp, cls);
    }The error message is as follows
    com.sun.faces.mgbean.ManagedBeanCreationException: Cant instantiate class: karma.com.managedbeans.master.CustomFields.
    at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:193)
    at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:102)
    at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:405)
    at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:267)
    Caused by: java.lang.ClassCastException: karma.com.model.ui.UiSetup cannot be cast to karma.com.model.ui.UiSetup
    at karma.com.managedbeans.master.CustomFields.<init>(CustomFields.java:397)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:188)
    ... 82 moreRegards,
    Swati

    Thanks very much for your reply. I have implemented your suggestion of using a PostConstruct method with the @ManagedProperty to inject the values into the tableName and the callerBean properties. The good news is that the page is rendered correctly and I haven't encountered the exception the few times that I invoked the page.
    However, I can't be sure the issue is resolved, since, like I mentioned, the error is seemingly erratic and I don't quite know if it is not seen because of a genuine fix or because, well, its currently not in a mood to show up.
    There is just one more thing I would like to mention. I have said that the code fails at the List.get() line. However, its not happening because the list is empty. In fact the earlier lines are giving expected outputs and totFields value is set all right. Maybe this has nothing to do with the error, but I thought I will mention it all the same, in case it triggers another idea altogether.
    Thanks very much
    Regards
    Swati

  • Setting up the Apache HTTP Plugin for several BEA Servers

    Hey together,
    i would like to setup the apache http plugin for several bea-servers.
    I am running apache 1.x on my hp-ux system. There are 2 bea-server-domains on this box and both should be proxied by the plugin simultaneously.
    As far as i know it isn't possible to run 2 or more instances of the apache webserver. I heard of virtualhosts, maybe i should try this one out.
    Somebody knows how to deal with this problem or does any1 know if virtualhosts could cope with my needs?
    Thanks in advance

    Ok here i am again and i'm stuck. Here my wishes again:
    there are 2 weblogic-instances (domains) running on a machine xxx, instance A listening on port 8041, instance B listening on port 8051. I want to configure apache virtualhosts in combination with weblogic plugins, so that request with /ld will be sent to instance A while requests with /ldd will be sent to instance B. Both are no clusters. Therefore i tried it with the following configuration (httpd.conf):
    <VirtualHost xxx:8080>
         DocumentRoot "/opt/hpws/apache/htdocs"
         ServerName xxx:8080
         <IfModule mod_weblogic.c>
         WebLogicHost xxx
         WebLogicPort 8041
         #MatchExpression *
         #PathPrepend=/test2
         </IfModule>
         <Location /ld>
         SetHandler weblogic-handler
         PathTrim /ld
         </Location>
    </VirtualHost>
    # VirtualHost2 = xxx:8090
    <VirtualHost xxx:8090>
         DocumentRoot "/opt/hpws/apache/htdocs"
         ServerName xxx:8090
         <IfModule mod_weblogic.c>
         WebLogicHost xxx
         WebLogicPort 8051
         #MatchExpression *
         #PathPrepend=/test2
         </IfModule>
         <Location /ldd>
         SetHandler weblogic-handler
         PathTrim /ldd
         </Location>
    Doesnt really work. Can some1 help please?
    Thanks

  • Using a Single HTTP Server for Multiple APEX Instances

    Our company's DBA Manager has asked if it would be possible to externalize the HTTP server portion of APEX from the DB Servers. In other words, he would strongly prefer that the DB Servers *only* run Oracle Database software.
    We know that we can install the HTTP server on another box but, in thinking about how to do this, we were wondering if it is really necessary to create a separate HTTP server installation for each APEX instance. What we'd really like to do is have one HTTP server for all our our Dev boxes and several (but, not one to one) for each of our upper environments; staging, qa, prod, etc.
    Right now, each instance have a single dads.conf file on each DB box. So, if we we're to attempt to consolidate them, we'd need some way to embed multiple dads files and to associate each instance with the correct one.
    Has anyone ever done this or (preferably) have some examples?
    Thanks,
    -Joe

    Joe,
    I don´t know a specific reference for it, I remembered it because when I was looking the documentation on the site, I saw the reference "Support for multiple database connections" in the URL: APEX Listener New Features 2.0&lt;/title&gt;&lt;meta name=&quot;Title&quot; content=&quot;APEX Listener New Features 2.0…
    I´ve tried to use APEX listener some time ago, but in a earlier version together with glassfish. So, since for me was only one database, I created the necessary amount of DAD´s on my database, each one for a specific port.
    Check the link and you´ll see the same information I saw.
    Thanks.
    José Valdézio
    "Neo, everything that Oracle told me, became true, except extinguish bugs in a first release."

  • How to setup HTTP client for HTTP to File scenario

    Hey guys
    i have a scenario wherein one of our clients is sending invoices(as XML message) over  HTTP(client is outside our landscape) and i have to to send this invoice to a File system from where it will be picked up by an ABAP code(picking of the file has to be done by ABAper so i m not concerned with that)
    the way i m starting off this project is that
    i will create a sender and receiver data type,message type and Message interface,Message mapping is 1-1 so its kinda simple and then Interface mapping.
    in configuration i wont be creating and sender communication channel and sender Agreement,i need receiver communication channel,receiver determination and interface determination.
    does my design and configuration looks good to you guys?
    also i waz goin through some threads and it says that i need to setup HTTP client for this scenario and then specify a URL in a specific format.
    where will i setup the HTTP client and where will i specify the URL?
    thanx
    ahmad

    Ahmad,
    ><i>does my design and configuration looks good to you guys?</i>
    Is correct.
    ><i>where will i setup the HTTP client and where will i specify the URL?</i>
    Take a look at this thread and check the HTTP Client code.
    Copy the code and save it as a HTML file and you have the HTTP Cliet ready. GIve the details of your server, sender service, interface etc and trigger the call to XI.
    In a real time scenario, you will need to use the URL used in the HTTP Client code from your WebApplication to trigger the call to XI.
    /message/266750#266750 [original link is broken]
    Regards
    Bhavesh

  • Companion CDs for 64-bit Oracle HTTP Server for AIX5L(64 bit) required.

    I need Companion CDs for 64 bit Oracle HTTP Server for AIX5L(64 bit).
    I tried to install using
    as_ibm_aix_companion_101300_disk1.cpio & as_ibm_aix_companion_101300_disk2.cpio
    but when i checked the files present in <Oracle_Home>/ohs/lib , they are of 32-bit.
    Also i tried with Oracle 10.1.2.0.2 but still the server is installed as 32-bit.
    Is 64-bit Oracle HTTP Server supported on AIX5L(64 bit) ?
    If yes, then from where can i download the CDs?
    Any suggestions will be appreciated.

    Greetings,
    Try this link:
    http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201aixsoft.html
    Regards,
    Bill Chadbourne

  • HTTP Server for Windows 64 bit not on the companion CD

    Hi,
    I cannot find the HTTP Server for Windows 64 bit on the companion CD. Any idea where I can get it from? For the 32bit version the HTTP Server is on the Companion CD.
    Thanks in advance,
    Florin

    If i am correct reason should be : Oracle Application Server 10g will run as a 32-bit application
    Following platforms have the same media in either case:
    Microsoft Windows 32-bit and EM64T/AMD64
    (Not Itanium-64, which is separate and referred to as "Windows 64-bit")
    Linux x86 and Linux x86-64
    Solaris Sparc 32-bit and Solaris Sparc 64-bit
    As the Oracle Application Server 10g will be run as a 32-bit application. See the Installation Guide or readme files for any specific steps on these 64-bit platforms.
    Refer the Note.433061.1 - How to Obtain Application Server 10g Media, Patchsets, and Patches

  • HTTP/SPNEGO for "SSO" on MS Windows

    HTTP/SPNEGO for "SSO" on MS Windows
    Hi all of you !
    The scene is simple : I got a software (All in plain java ) and some simple web access to this system. ( it's not a real web server wich will be in need for Apache or some big container it's just a few access to some informations of the software )
    The client company is all MS Windows, and it's used to some SSO approach,
    they got a AD server on Win2003, all laptops are under winXP Pro and got IE at least version 6
    Now The question is this ;
    I got
    -a guy (properly authentified) who is
    - using IE (properly setted)
    - on a computer (properly attached to AD)
    to access a ressource URL of my app
    It's quite simple to send him a http 401 or 407 so IE go back to the AD server and get its token
    BUT how can I manage in java to extract the account used by the client
    from the SPENEGO token ? this is all I need
    I cant find any help on this, So please if someone can help me in this...
    I'm lost ... Thanks in adavnce for a simple hint or a url linking me on the good path

    I forget :
    Ok for the configuration, thanks to some of your posts (thanks all)
    I know all the importants steps to be followed
    For exemple I quote danielshrem last post on the thread http://forum.java.sun.com/thread.jspa?forumID=545&threadID=760214
    <quote>
    Hey Seema,
    Indeed my server's principal was not the correct one, now everything is cool with rc4 encryption.
    for all u dudes out there in need of Java HTTP kerberos auth here's a few simple configuration procedures:
    1. on the Domain Controller add an HTTP SPN to the account running the web service (use setspn.exe). the SPN has to be in format HTTP/host@Realm or HTTP/host (this SPN worked for me). if u dont know exactly which SPN u need u can sniff an HTTP session on ethereal look for Kerberos AP Req-->ticket-->Server Name. from what i gather this is the principal the clients use.
    2. on the DC add a mapping to the newly created SPN (use ktpass.exe)
    3. on the host running the service create a keytab file containing the newly created HTTP principal (use java's ktab.exe)
    4. make sure the SPN is set up OK by running kinit and pass the newly created keytab file and the newly created SPN.
    once u recieve an ok result you are good to go (login and authenticate users)
    hope this helps
    Daniel.
    </quote>
    My problem (I know it must sounds stupid) : how do I extract the login account from this ?

  • HTTP handler for starting an external service cannot be read

    Hi,
    When i execute the work item from Business Work place and also from the UWL in Enterprise portal of the task TS21300098 for HR Process Requisition workflow.
    In the Error is says
    HTTP handler for starting an external service cannot be read
    Message no. SWK045
    Diagnosis
    This work item is a link to a HTTP service. To start the service, a launch handler must be known to the SAP System.
    However, the system could not find a launch handler.
    System Response
    The workflow system cannot start execution of the work item.
    Procedure
    Contact your workflow administrator:
    In Customizing you must maintain a launch handler for HTTP-supported dialog services.
    I have checked the config under WF_HANDCUST transaction and made the launch Handler settings generated automatically.
    But still the problem occurs.
    Any Suggesions and help?
    Thanks & Regards
    Sumanth

    hi Guys,
    I have got the same issue. This blog helped me with tcode WF_HANDCUST. I have generated the url
    http://waspgh.kcc.com:8083/sap/bc/webflow/wshandler-->Click on Generate URL and click on distribution.
    Immediately u will get click on Test url . Click Test url . Then It is not successful. It stopped at 
    http://waspgh.kcc.com:8083/sap/bc/webflow
    Getting http page error. So use tcode sicf >sap>bc-->webflow service and activate it.
    Then test the connection. It will be successfull.
    http://waspgh.kcc.com:8083/sap/bc/webflow/wshandler?ping=true&sap-client=400
    Handler test
    Test successful
    Thanks,
    Shankar

  • What should be configured as channel in Oracle CEP HTTP adapter for remote publishing?

    Hi,
    Below is the adapter configuration that I have for Oracle CEP HTTP adapter for remote publishing. What exactly should be configured in <channel> here? In the oracle documentation example, it only says /channel2 as an example.
    Below is the HTTP adapter configuration file that I have created.
    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application">
        <http-pub-sub-adapter>
            <name>HttpPostAdapter</name>
            <server-url>http://localhost:8080/RESTfulWS/rest/UserInfoService/post/jsonstream</server-url>
            <channel>/RESTfulWS</channel>
            <event-type>com.wipro.event.ResultEvent1</event-type>
        </http-pub-sub-adapter>
    </wlevs:config>
    '/RESTfulWS' in my above configuration is the context-root of my rest service.But this is not working so I would like someone to help me understand this configuration.
    Many thanks.
    Regards
    Sowmya

    Hi, Sowmya,
    From your configuration
    Is the http://localhost:8080/RESTfulWS/rest/UserInfoService/post/jsonstream httppubsub server? I don't think the oep http pub adapter can publish event to rest service.
    For http pub adapter, you can take a look at fx sample, it publishes events to a embedded http pub/sub server of oep.
    Thanks,
    Gala

  • How  to create and test HTTP connection for proxy

    HI
    Can anybody help me by providing step by step guide for how to create a HTTP connection for inbound abap proxy?
    How i will get sure that connection is working properly?
    Thanks
    Debraj

    Hi Debraj,
       You should be able to do that in SM59 of the XI Box.
    Create the connection under "HTTP Connections to R/3 System".
    Provide the Target Host IP Address.Service Number and Path Prefix.
    Select the logon procedure as SAP Standard.
    SSL Inactive.
    Provide Logon details.
    Regards,
    Ravi

  • I get an Invalid Certificate notice when I try to access my https site for my printer. The serial number is the same as used by another certificate. In IE I was able to proceed to this address, but Firefox won't give me that option

    I get an Invalid Certificate notice when I try to access my https site for my printer. The serial number is the same as used by another certificate. In IE I was able to proceed to this address, but Firefox won't give me that option

    Hello,
    Thanks for contacting Mozilla Support!
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • HTTPS (SSL) for an internal application: benefits? costs?

    This is a traditional SAP R/3 customer, recently upgraded to ECC (ECC 6.0, Basis 7.0). We are still using the ABAP stack only, with no plans of installing the Java stack, installing SAP EP portal, … .
    A small "Web Dynpro for ABAP" (WDA) application has been developed, as an exploration into the world of WDA. It is intended for occasional users - users who rarely  use the SAP system and who do not have the SAP GUI for Windows installed on their PC. It is purely an internal service (intranet) - not customer-facing, only available on the internal network.
    It is currently using plain HTTP, but the question has been raised whether we should use HTTPS (in other words, set up for SSL).
    What would be gained by doing this and how much would it cost?
    If I understand correctly, it would enable server authentication. You would be certain that it is the genuine SAP server that is asking for your username and password, not some phishing scheme - not really a big issue on the internal network. (We could buy a server certificate from the SAP TC Trustcenter CA - 260 EUR excl VAT.)
    It would also enable client authentication. If I understand correctly, this would remove the need for username/password log-in, but it would require the creation of certificates for each one of those users, to be distributed to each one of them and installed in their browser. No small undertaking! This sounds like the scheme used for the "SAP Passport" in the SAP Service MarketPlace.

    First you can turn on HTTPS without the use of client certificates.  These are two different things.  You can have HTTPS and still use basic authentication or forms based authentication.  You could do certificates as well (which then would require HTTPS), but certificates are not a requirement if you just want to do HTTPS.
    The main benefit of HTTPS is the encryption of the data as it travels through your network.  With plain HTTP, anyone with a network sniffer could read any of the data across the network (including the user's password when they login).  The question probably comes back to how much you trust the security of your internal network.  But also you might consider what a rouge employee could do with some basic network knowledge - mainly gaining other users passwords.
    That is also why SAP offers a hybrid approach called switch to HTTPS for logon. This is a setting in the logon configuration in the service nodes in transaction SICF.  This way you switch into HTTPS just for the logon screen.  The password is sent encrypted.  Then for the application data itself, you switch back into HTTP.  This way you don't pay the performance cost of encrypting all the data for every HTTP request/response.

  • Oracle HTTP Server for APEX3.2

    I am a DBA but new to APEX.
    On page 4-15 of APEX3.2 Installation Guide, it says
    Install from the Database and Configure Oracle HTTP Server
    This section describes how to configure Oracle HTTP Server with mod_plsql
    distributed with Oracle Database 11g or Oracle Application Server 10g.
    It seems that Oracle HTTP Server is neither distributed with the database CD nor Example CD. Am I right?
    Also, can I use HTTP Server bundled with OMS to serve as HTTP Server for APEX? Will that impact Grid Control?
    EPG is not considered.
    Thanks,
    Kevin

    Hi
    When using Grid of course, there is a HTTP server
    When having the Rdbms, you need the companion cd or use one of products that has already HTTP server .... ( Example ; IAS, etc )
    Kind regards,
    Iloon

  • Http Header for SOAP message.

    Hello,
    I need to set some custom HTTP Header when i send the SOAP message to an endpoint.
    I tried this..but doesn't solve my requirement.
    SOAPMessage soapmsg = messageFactory.createMessage();
    MimeHeaders mime = soapmsg.getMimeHeaders();
    mime.addHeader("SOAPAction", "xxxx");
    mime.addHeader("Sender", "yyy");
    SOAPMessage reply = connection.call(soapmsg, destination);
    Can anyone please guide me how to set HTTP headers for SOAP?
    Thanks,

    The following snippet is some code froma stand-alone web service client that I use for testing. It picks up an XML as the payload of the web service, wraps it in a SOAP message and fires it at the web service endpoint.
         System.out.println("Create the SOAP message.\n"); 
         MessageFactory messageFactory = MessageFactory.newInstance();
         SOAPMessage message = messageFactory.createMessage();
         System.out.println("Creating a DOM object from the JAXB payload.");
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              factory.setValidating(false);
                 factory.setNamespaceAware(true);
         DocumentBuilder parser = factory.newDocumentBuilder();
         Document doc = parser.parse("file:payload.xml");
         //  Add the HTTP headers.
         message.getMimeHeaders().addHeader("User-Agent", "Mozilla/4.0 [en] (WinNT; I)");
         message.getMimeHeaders().addHeader("Host", "localhost:9080");
         message.getMimeHeaders().addHeader("Content-type", "text/xml");
         message.getMimeHeaders().addHeader("SOAPAction", "http://www.xxx.com.au/wsdl/someWebService");
         message.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "utf-8");
         SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
         envelope.addNamespaceDeclaration("n", "http://xxx/webService");
         envelope.addNamespaceDeclaration("xsd", "http://www.w3.org/2001/XMLSchema");
         envelope.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
         System.out.println("Adding the payload to the SOAP body.\n");
         SOAPBody body = message.getSOAPBody();
         SOAPBodyElement docElement = body.addDocument(doc);
         System.out.println("This is the SOAP message.\n");
         message.writeTo(System.out);
         System.out.println("\nPutting the payload on the wire.\n");
         SOAPConnectionFactory conFactry = SOAPConnectionFactory.newInstance();
         SOAPConnection connection = conFactry.createConnection();          
         URL endpoint = new URL("http://localhost:9080/xxx/services/yyy-webservices");
         SOAPMessage response = connection.call(message, endpoint);
         System.out.println("Payload sent. Closing the connection.\n");
         connection.close();

Maybe you are looking for