By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,143 Members | 1,854 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,143 IT Pros & Developers. It's quick & easy.

Geting meta data from Web Service

P: n/a
Hello,
I was trying to do a WCF tutorial (http://wcf.netfx3.com/content/
BuildingHelloWorld.aspx). I need to get the meta data from my service
usin svcutil.exe why is not working? Please see below:
E:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>svcutil http://localhost/hello?wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version
3.0.4506.30]
Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://localhost/hello?wsdl'
using WS-Metadata Exchange or
DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version
3.0.4506.30]
Copyright (c) Microsoft Corporation. All rights reserved.

Error: Cannot obtain Metadata from http://localhost/hello?wsdl

If this is a Windows (R) Communication Foundation service to which you
have access, please check
that you have enabled metadata publishing at the specified address.
For help enabling metadata
publishing, please refer to the MSDN documentation at
http://go.microsoft.com/fwlink/?LinkId=65
455.
WS-Metadata Exchange Error
URI: http://localhost/hello?wsdl

Metadata contains a reference that cannot be resolved: 'http://
localhost/hello?wsdl'.

Content Type application/soap+xml; charset=utf-8 was not supported
by service http://localho
st/hello?wsdl. The client and service bindings may be mismatched.

The remote server returned an error: (415) Cannot process the
message because the content ty
pe 'application/soap+xml; charset=utf-8' was not the expected type
'text/xml; charset=utf-8'..
HTTP GET Error
URI: http://localhost/hello?wsdl

The HTML document does not contain Web service discovery
information.

If you would like more help, type "svcutil /?"

E:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>

Apr 26 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Dylan,

If you go to http://localhost/hello?wsdl in your browser, do you get
anything?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dylan" <dy********@gmail.comwrote in message
news:11********************@b40g2000prd.googlegrou ps.com...
Hello,
I was trying to do a WCF tutorial (http://wcf.netfx3.com/content/
BuildingHelloWorld.aspx). I need to get the meta data from my service
usin svcutil.exe why is not working? Please see below:
E:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>svcutil
http://localhost/hello?wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version
3.0.4506.30]
Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://localhost/hello?wsdl'
using WS-Metadata Exchange or
DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version
3.0.4506.30]
Copyright (c) Microsoft Corporation. All rights reserved.

Error: Cannot obtain Metadata from http://localhost/hello?wsdl

If this is a Windows (R) Communication Foundation service to which you
have access, please check
that you have enabled metadata publishing at the specified address.
For help enabling metadata
publishing, please refer to the MSDN documentation at
http://go.microsoft.com/fwlink/?LinkId=65
455.
WS-Metadata Exchange Error
URI: http://localhost/hello?wsdl

Metadata contains a reference that cannot be resolved: 'http://
localhost/hello?wsdl'.

Content Type application/soap+xml; charset=utf-8 was not supported
by service http://localho
st/hello?wsdl. The client and service bindings may be mismatched.

The remote server returned an error: (415) Cannot process the
message because the content ty
pe 'application/soap+xml; charset=utf-8' was not the expected type
'text/xml; charset=utf-8'..
HTTP GET Error
URI: http://localhost/hello?wsdl

The HTML document does not contain Web service discovery
information.

If you would like more help, type "svcutil /?"

E:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>

Apr 26 '07 #2

P: n/a
If you use a "hello world" svc file hosted in IIS (which you can get
by installing the WCF/WPF CTP onto VS2005), then simply browsing to
the svs tells you exactly how to enable mex. To quote (and note the
link at the bottom):

================

Service
This is a Windows© Communication Foundation service.

Metadata publishing for this service is currently disabled.

If you have access to the service, you can enable metadata publishing
by completing the following steps to modify your web or application
configuration file:

1. Create the following service behavior configuration, or add the
<serviceMetadataelement to an existing service behavior
configuration:

<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>

2. Add the behavior configuration to the service:

<service name="MyNamespace.MyServiceType"
behaviorConfiguration="MyServiceTypeBehaviors" >

Note: the service name must match the configuration name for the
service implementation.

3. Add the following endpoint to your service configuration:

<endpoint contract="IMetadataExchange" binding="mexHttpBinding"
address="mex" />

Note: your service must have an http base address to add this
endpoint.

The following is an example service configuration file with metadata
publishing enabled:

<configuration>
<system.serviceModel>

<services>
<!-- Note: the service name must match the configuration
name for the service implementation. -->
<service name="MyNamespace.MyServiceType"
behaviorConfiguration="MyServiceTypeBehaviors" >
<!-- Add the following endpoint. -->
<!-- Note: your service must have an http base address
to add this endpoint. -->
<endpoint contract="IMetadataExchange"
binding="mexHttpBinding" address="mex" />
</service>
</services>

<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<!-- Add the following element to your service
behavior configuration. -->
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>

</system.serviceModel>
</configuration>

For more information on publishing metadata please see the following
documentation: http://go.microsoft.com/fwlink/?LinkId=65455.

Apr 26 '07 #3

P: n/a
On Apr 26, 1:41 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Dylan,

If you go tohttp://localhost/hello?wsdlin your browser, do you get
anything?

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"Dylan" <dylanjh...@gmail.comwrote in message

news:11********************@b40g2000prd.googlegrou ps.com...
Hello,
I was trying to do a WCF tutorial (http://wcf.netfx3.com/content/
BuildingHelloWorld.aspx). I need to get the meta data from my service
usin svcutil.exe why is not working? Please see below:
E:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>svcutil
http://localhost/hello?wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version
3.0.4506.30]
Copyright (c) Microsoft Corporation. All rights reserved.
Attempting to download metadata from 'http://localhost/hello?wsdl'
using WS-Metadata Exchange or
DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version
3.0.4506.30]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Cannot obtain Metadata fromhttp://localhost/hello?wsdl
If this is a Windows (R) Communication Foundation service to which you
have access, please check
that you have enabled metadata publishing at the specified address.
For help enabling metadata
publishing, please refer to the MSDN documentation at
http://go.microsoft.com/fwlink/?LinkId=65
455.
WS-Metadata Exchange Error
URI:http://localhost/hello?wsdl
Metadata contains a reference that cannot be resolved: 'http://
localhost/hello?wsdl'.
Content Type application/soap+xml; charset=utf-8 was not supported
by servicehttp://localho
st/hello?wsdl. The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the
message because the content ty
pe 'application/soap+xml; charset=utf-8' was not the expected type
'text/xml; charset=utf-8'..
HTTP GET Error
URI:http://localhost/hello?wsdl
The HTML document does not contain Web service discovery
information.
If you would like more help, type "svcutil /?"
E:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>- Hide quoted text -

- Show quoted text -
Hi,

When I put http://localhost/hello?wsdlin in the browser,

I get the Service page and this message at the top: "Metadata
publishing for this service is currently disabled"
I guess I have not hosted my the service properly and have not enabled
metadata publishing.

Dylan

Apr 27 '07 #4

P: n/a
I guess I have not hosted my the service properly and have not enabled
metadata publishing.
The two aren't related. The fact you see something other thant a
yellow-screen-of-death tells me it is hosted fine. Metadata publishing
isn't enabled by default, but just follow the steps it cites.

Marc

Apr 27 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.