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 6768801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:07:02+00:00 2026-05-26T15:07:02+00:00

I try to access from a browser a simple mailing list service I developed.

  • 0

I try to access from a browser a simple mailing list service I developed. I adapted a working example I found but I don’t know why the request doesn’t seem to reach the service and so no response is returned.

Using a SOAP envelope is a requirement, I need to know what is possibly wrong with this code, not how I could do the same thing using other techniques. (The service is deployed correctly on a GlassFish server and I have a working Java client to test it, so no problem with the service)

Does anyone see something bad (I’m joining the WSDL too, if you need any other detail don’t hesitate)? Thanks!

<html>
<head>
    <title>Soap Invocation</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <script type="text/javascript">

        var request = null;

        function createRequest() {
            if (window.XMLHttpRequest){
                request=new XMLHttpRequest();
            }
            else{
                if (new ActiveXObject("Microsoft.XMLHTTP")) {
                    request = new ActiveXObject("Microsoft.XMLHTTP");
                } else {
                    request = new ActiveXObject("Msxml2.XMLHTTP");
                }
            } 
        }

        function getMail() {
            createRequest();
            var envelope = "<?xml version='1.0' encoding='UTF-8'?>";
            envelope += "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>";
            envelope += "<soap:Header/>";
            envelope += "<soap:Body>";
            envelope += "<ns2:getMails xmlns:ns2='http://service.inf4375.com/'>";
            envelope += "</ns2:getMails>";
            envelope += "</soap:Body>";
            envelope += "</soap:Envelope>";

            var url = "http://127.0.0.1:8080/SoapService/MailingService";

            request.onreadystatechange = updatePage;

            request.open("GET", url, false);
            request.setRequestHeader("Content-Type", "text/html");
            request.setRequestHeader("SOAPAction", "");
            request.send(envelope);
        }

        function updatePage() {

            if(request.readyState == 4) {
                document.getElementById("get").innerHTML = "<p>" + request.responseXML.selectSingleNode("//return").text + "</p>";
            } else {
                document.getElementById("get").innerHTML = "Loading..."
            }

        }
    </script>
</head>
<body>
    <input type="button" value="GetMail" onclick="getMail();" />
    <span id="get"></span>       
</body>
</html>

The WSDL :

<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.inf4375.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://service.inf4375.com/" name="MailingService">
<types>
    <xsd:schema>
        <xsd:import namespace="http://service.inf4375.com/" schemaLocation="http://localhost:8080/SoapService/MailingService?xsd=1"/>
    </xsd:schema>
</types>
<message name="getMails">
    <part name="parameters" element="tns:getMails"/>
</message>
<message name="getMailsResponse">
    <part name="parameters" element="tns:getMailsResponse"/>
</message>
<message name="addMail">
    <part name="parameters" element="tns:addMail"/>
</message>
<message name="addMailResponse">
    <part name="parameters" element="tns:addMailResponse"/>
</message>
<portType name="Mailing">
    <operation name="getMails">
        <input wsam:Action="http://service.inf4375.com/Mailing/getMailsRequest" message="tns:getMails"/>
        <output wsam:Action="http://service.inf4375.com/Mailing/getMailsResponse" message="tns:getMailsResponse"/>
    </operation>
    <operation name="addMail">
        <input wsam:Action="http://service.inf4375.com/Mailing/addMailRequest" message="tns:addMail"/>
        <output wsam:Action="http://service.inf4375.com/Mailing/addMailResponse" message="tns:addMailResponse"/>
    </operation>
</portType>
<binding name="MailingPortBinding" type="tns:Mailing">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="getMails">
        <soap:operation soapAction=""/>
        <input>
            <soap:body use="literal"/>
        </input>
        <output>
            <soap:body use="literal"/>
        </output>
    </operation>
    <operation name="addMail">
        <soap:operation soapAction=""/>
        <input>
            <soap:body use="literal"/>
        </input>
        <output>
            <soap:body use="literal"/>
        </output>
    </operation>
</binding>
<service name="MailingService">
    <port name="MailingPort" binding="tns:MailingPortBinding">
        <soap:address location="http://localhost:8080/SoapService/MailingService"/>
    </port>
</service>

I don’t get any errors in the Error Console when I’m trying to execute it on Firefox, and Internet Explorer is only displaying the Loading... and nothing more.

  • 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-05-26T15:07:02+00:00Added an answer on May 26, 2026 at 3:07 pm

    SOAP must be sent via a POST, not a GET.

    Also, it looks like your WS-Messaging headers are wrong. In fact, I don’t even see them.

    Try issuing this call using a .NET client (“Add Service Reference”), and watch on the wire with Fiddler or something like it to see what’s happening. Then do the same thing.

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

Sidebar

Related Questions

From my android code I try with the android browser to access a tomcat
When you try to access a key which isn't in a Dictionary (for example),
I am having an issue where I try to access the Lists.asmx web service
I'm looking to try and block access from two IP addresses in PHP, preferably
Im trying to access a web service from a remote computer. I managed to
I'm trying to reload web application from ant. but I got error not found:
I try to get a access token from facebook with my (in creation) facebook
If I try and access some random string in the URL of my rails
When I try to access info that is not presented in xml like so:
My app crash when I try to access any property of my NSDecimalNumber amount_before_current_year:

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.