Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2004

Tip: Looking for answers? Try searching our database.

Not Authorized connecting Webservice in a trusted Domain

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SqlJunkies User - 03 Dec 2004 06:18 GMT
Hi
I try to call a Webservice via java, the webservice is loacated on a IIS-server(Dot-net).
It is a trusted Domain so I do not have to Connect with a Username and Password.
It seems to be a problem to get Information from the Service. At all I do not get Access.
Anybody have same problem or experiance with this.
I use following Code to access the Webservice. If anybody have other suggestions I am willing to try that

My Code.
import org.apache.soap.*;
import org.apache.soap.messaging.*;
import org.apache.soap.transport.http.*;
import javax.activation.*;
import org.xml.sax.*;
import java.io.*;
import java.util.Iterator;
public class JavaAgent {

Public void NotesMain() {
try {

String retval = "";

String url ="http://xxxxxxxxx.asmx";
System.out.println("url"+url);
String TargetNamespace ="http://tempuri.org/";

String SOAPAction ="http://tempuri.org/GetFunctione1";

if (url == null) {
throw new org.apache.soap.SOAPException(Constants.FAULT_CODE_CLIENT,
"A URL must be specified via " +
"SoapBuildersExSoapProxy.setEndPoint(URL).");
}

// Instantiate the message and the envelope.
// The message sends the envelope and gets
// the response.
Message message = new Message();
Envelope env = new Envelope();
DataHandler soapMsg = null;

// Get this from the soapAction attribute on the
// soap:operation element that is found within the SOAP
// binding information in the WSDL.
MessageBody theBody = new MessageBody();

theBody.orgId ="C42F504C40BB0A1EC1256F3F0032A80B";
theBody.dokType="6";

// Replace the default body with our own.
env.setBody( theBody );
message.send(new java.net.URL(url) , SOAPAction, env );
try{
// Because the Body.unmarshall handler is static,
// you cannot replace the basic machinery easily.
// Instead, you must obtain and parse the
// message on your own.
soapMsg = message.receive();

System.out.println( "***Result***: " + soapMsg.getContent().toString());
} catch ( Exception e ) {
System.out.println( "***Exception***: " + e.toString() );
}

} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
JavaAgent ja = new JavaAgent();
ja.NotesMain();
}
}

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Dan Rogers - 03 Dec 2004 20:34 GMT
Hi,

Can you post the error you are receiving?

I suspect that this is a security setting issue on either the IIS side or
within the web service itself.  If IIS, it sounds like you are expecting
the service site or vroot to allow anonymous access.  Have you checked the
settings to assure this?

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
From: SqlJunkies User <User@-NOSPAM-SqlJunkies.com>
Organization: http://www.wimdows.net/newsgroups/
X-Newsreader: Wimdows.net NntpNews
Subject: Not Authorized connecting Webservice in a trusted Domain
Message-ID: <#u5$x$P2EHA.804@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Date: Thu, 02 Dec 2004 22:18:44 -0800
NNTP-Posting-Host: daisycutter 64.85.22.116
Lines: 1        
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl!cpmsftngxa0
6.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7787
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi
I try to call a Webservice via java, the webservice is loacated on a
IIS-server(Dot-net).
It is a trusted Domain so I do not have to Connect with a Username and
Password.
It seems to be a problem to get Information from the Service. At all I do
not get Access.
Anybody have same problem or experiance with this.
I use following Code to access the Webservice. If anybody have other
suggestions I am willing to try that

My Code.
import org.apache.soap.*;
import org.apache.soap.messaging.*;
import org.apache.soap.transport.http.*;
import javax.activation.*;
import org.xml.sax.*;
import java.io.*;
import java.util.Iterator;
public class JavaAgent {

Public void NotesMain() {
try {

String retval = "";

String url ="http://xxxxxxxxx.asmx";
System.out.println("url"+url);
String TargetNamespace ="http://tempuri.org/";

String SOAPAction ="http://tempuri.org/GetFunctione1";

if (url == null) {
throw new org.apache.soap.SOAPException(Constants.FAULT_CODE_CLIENT,
"A URL must be specified via " +
"SoapBuildersExSoapProxy.setEndPoint(URL).");
}

// Instantiate the message and the envelope.
// The message sends the envelope and gets
// the response.
Message message = new Message();
Envelope env = new Envelope();
DataHandler soapMsg = null;

// Get this from the soapAction attribute on the
// soap:operation element that is found within the SOAP
// binding information in the WSDL.
MessageBody theBody = new MessageBody();

theBody.orgId ="C42F504C40BB0A1EC1256F3F0032A80B";
theBody.dokType="6";

// Replace the default body with our own.
env.setBody( theBody );
message.send(new java.net.URL(url) , SOAPAction, env );
try{
// Because the Body.unmarshall handler is static,
// you cannot replace the basic machinery easily.
// Instead, you must obtain and parse the
// message on your own.
soapMsg = message.receive();

System.out.println( "***Result***: " + soapMsg.getContent().toString());
} catch ( Exception e ) {
System.out.println( "***Exception***: " + e.toString() );
}

} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
JavaAgent ja = new JavaAgent();
ja.NotesMain();
}
}

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
supports Post Alerts, Ratings, and Searching.

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.