Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8976659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:11:54+00:00 2026-06-15T19:11:54+00:00

I’m new in webservice. I’ve to pass xml to aspx web service called plog.asmx

  • 0

I’m new in webservice.

I’ve to pass xml to aspx web service called plog.asmx

here is my code

String xmldata = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + 
            "<SOAP:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + 
              "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " + 
              "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" >" +
              "<![CD[<soap:Body>" +
              "<SubmitJob xmlns=\"http://www.xdel.biz/XWS/\"> " +
              "<APIKey>"+ API_KEY +"</APIKey>" +
              "<Job>" +
               "<Customer_Name>"+ Customer_Name +"</Customer_Name>" +
               "<Address1>"+ Address1 +"</Address1>" +
                "<Address2>"+ Address2 +"</Address2>" +
                "<Postal_Code>"+ Postal_Code +"</Postal_Code>" +
                "<Phone_Number>"+ Phone_Number +"</Phone_Number>" +
                "<Mobile_Number>"+ Mobile_Number +"</Mobile_Number>" +
                "<Order_Reference>"+ Order_Reference +"</Order_Reference>" +
                "<Delivery_Instructions>"+ Delivery_Instructions +"</Delivery_Instructions>" +
              "</Job>]]>" +
            "</SubmitJob>" +
              "</soap:Body>]]>" +
              "</SOAP:Envelope>";

             System.out.println(xmldata); 


              try{
                  //Create socket
                  String hostname = "www.xdel.biz";
                  int port = 80;
                  InetAddress  addr = InetAddress.getByName(hostname);                    
                  Socket sock = new Socket(addr, port);
                  System.out.println(sock.toString());                    

                  //Send header
                  String path = "/xws/plog.asmx";
                  BufferedWriter  wr = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream(),"UTF-8"));
                  // You can use "UTF8" for compatibility with the Microsoft virtual machine.
                  wr.write("POST " + path + " HTTP/1.1\r\n");
                  wr.write("Host: www.xdel.biz\r\n");
                  wr.write("Content-Type: text/xml; charset=utf-8\r\n");
                  wr.write("Content-Length: " + xmldata.length() + "\r\n");                   
                  wr.write("SOAPAction: \"http://www.xdel.biz/XWS/SubmitJob\" \r\n");
                  wr.write("\r\n");

                  //Send data
                  wr.write(xmldata);
                  wr.flush();

                  System.out.println("1");

                  // Response
                  BufferedReader rd = new BufferedReader(new InputStreamReader(sock.getInputStream()));
                  String line;
                  while((line = rd.readLine()) != null){
                      System.out.println(line);
                  }

                } catch (Exception e) {
                  e.printStackTrace();
                }

when I run the code, I got error like this

HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 13 Dec 2012 09:37:12 GMT
Content-Length: 0

I googled the error and tried to fix but no solution come out..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:11:55+00:00Added an answer on June 15, 2026 at 7:11 pm

    A good ideia would be to use an API that implements SOAP webservice and is already tested.

    I used this
    JAX-WS

    400 Bad Request sometimes happens when you mismatch the protocol(SOAP or HTTP)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
Specifically, suppose I start with the string string =hello \'i am \' me And
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.